mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
remove libartifact from podman
pkg/libartifact has been moved to common and as such needs to be removed from podman and the new common vendored in along with required deps. https://issues.redhat.com/browse/RUN-3618 Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
21
vendor/github.com/google/go-containerregistry/pkg/name/digest.go
generated
vendored
21
vendor/github.com/google/go-containerregistry/pkg/name/digest.go
generated
vendored
@@ -17,6 +17,7 @@ package name
|
||||
import (
|
||||
// nolint: depguard
|
||||
_ "crypto/sha256" // Recommended by go-digest.
|
||||
"encoding"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
@@ -32,8 +33,11 @@ type Digest struct {
|
||||
original string
|
||||
}
|
||||
|
||||
// Ensure Digest implements Reference
|
||||
var _ Reference = (*Digest)(nil)
|
||||
var _ encoding.TextMarshaler = (*Digest)(nil)
|
||||
var _ encoding.TextUnmarshaler = (*Digest)(nil)
|
||||
var _ json.Marshaler = (*Digest)(nil)
|
||||
var _ json.Unmarshaler = (*Digest)(nil)
|
||||
|
||||
// Context implements Reference.
|
||||
func (d Digest) Context() Repository {
|
||||
@@ -79,6 +83,21 @@ func (d *Digest) UnmarshalJSON(data []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalText formats the digest into a string for text serialization.
|
||||
func (d Digest) MarshalText() ([]byte, error) {
|
||||
return []byte(d.String()), nil
|
||||
}
|
||||
|
||||
// UnmarshalText parses a text string into a Digest.
|
||||
func (d *Digest) UnmarshalText(data []byte) error {
|
||||
n, err := NewDigest(string(data))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*d = n
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDigest returns a new Digest representing the given name.
|
||||
func NewDigest(name string, opts ...Option) (Digest, error) {
|
||||
// Split on "@"
|
||||
|
||||
Reference in New Issue
Block a user