mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +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:
37
vendor/github.com/google/go-containerregistry/pkg/name/registry.go
generated
vendored
37
vendor/github.com/google/go-containerregistry/pkg/name/registry.go
generated
vendored
@@ -15,6 +15,8 @@
|
||||
package name
|
||||
|
||||
import (
|
||||
"encoding"
|
||||
"encoding/json"
|
||||
"net"
|
||||
"net/url"
|
||||
"path"
|
||||
@@ -37,6 +39,11 @@ type Registry struct {
|
||||
registry string
|
||||
}
|
||||
|
||||
var _ encoding.TextMarshaler = (*Registry)(nil)
|
||||
var _ encoding.TextUnmarshaler = (*Registry)(nil)
|
||||
var _ json.Marshaler = (*Registry)(nil)
|
||||
var _ json.Unmarshaler = (*Registry)(nil)
|
||||
|
||||
// RegistryStr returns the registry component of the Registry.
|
||||
func (r Registry) RegistryStr() string {
|
||||
return r.registry
|
||||
@@ -140,3 +147,33 @@ func NewInsecureRegistry(name string, opts ...Option) (Registry, error) {
|
||||
opts = append(opts, Insecure)
|
||||
return NewRegistry(name, opts...)
|
||||
}
|
||||
|
||||
// MarshalJSON formats the Registry into a string for JSON serialization.
|
||||
func (r Registry) MarshalJSON() ([]byte, error) { return json.Marshal(r.String()) }
|
||||
|
||||
// UnmarshalJSON parses a JSON string into a Registry.
|
||||
func (r *Registry) UnmarshalJSON(data []byte) error {
|
||||
var s string
|
||||
if err := json.Unmarshal(data, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
n, err := NewRegistry(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*r = n
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalText formats the registry into a string for text serialization.
|
||||
func (r Registry) MarshalText() ([]byte, error) { return []byte(r.String()), nil }
|
||||
|
||||
// UnmarshalText parses a text string into a Registry.
|
||||
func (r *Registry) UnmarshalText(data []byte) error {
|
||||
n, err := NewRegistry(string(data))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*r = n
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user