Documentation
¶
Index ¶
- Constants
- func Parse(optsPtr interface{}) error
- type BinaryTarget
- type Cache
- type Common
- type DistributionSpec
- type FlagParser
- type Platform
- type ReadOnlyGraphTagFinderTarget
- type Remote
- func (opts *Remote) Credential() auth.Credential
- func (opts *Remote) EnableDistributionSpecFlag()
- func (opts *Remote) NewRegistry(registry string, common Common, logger *slog.Logger) (reg *remote.Registry, err error)
- func (opts *Remote) NewRepository(reference string, common Common, logger *slog.Logger) (repo *remote.Repository, err error)
- func (opts *Remote) Parse() error
- type Target
- func (opts *Target) AnnotatedReference() string
- func (opts *Target) EnsureReferenceNotEmpty() error
- func (opts *Target) NewReadonlyTarget(ctx context.Context, common Common, logger *slog.Logger) (ReadOnlyGraphTagFinderTarget, error)
- func (opts *Target) NewTarget(common Common, logger *slog.Logger) (oras.GraphTarget, error)
- func (opts *Target) Parse() error
- type Transport
Constants ¶
const ( TargetTypeRemote = "registry" TargetTypeOCILayout = "oci-layout" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BinaryTarget ¶
BinaryTarget struct contains flags and arguments specifying two registries or image layouts.
func (*BinaryTarget) EnableDistributionSpecFlag ¶
func (opts *BinaryTarget) EnableDistributionSpecFlag()
EnableDistributionSpecFlag set distribution specification flag as applicable.
func (*BinaryTarget) Parse ¶
func (opts *BinaryTarget) Parse() error
Parse parses user-provided flags and arguments into option struct.
type Cache ¶
type Cache struct {
Root string
}
func (*Cache) CachedTarget ¶
func (opts *Cache) CachedTarget(src oras.ReadOnlyTarget) (oras.ReadOnlyTarget, error)
CachedTarget gets the target storage with caching if cache root is specified.
type Common ¶
type Common struct {
Debug bool
Verbose bool
TTY *os.File
// contains filtered or unexported fields
}
Common option struct.
type DistributionSpec ¶
type DistributionSpec struct {
// ReferrersAPI indicates the preference of the implementation of the Referrers API.
// Set to true for referrers API, false for referrers tag scheme, and nil for auto fallback.
ReferrersAPI *bool
// contains filtered or unexported fields
}
DistributionSpec option struct.
func (*DistributionSpec) Parse ¶
func (opts *DistributionSpec) Parse() error
Parse parses flags into the option.
type ReadOnlyGraphTagFinderTarget ¶
type ReadOnlyGraphTagFinderTarget interface {
oras.ReadOnlyGraphTarget
registry.TagLister
}
ReadOnlyGraphTagFinderTarget represents a read-only graph target with tag finder capability.
type Remote ¶
type Remote struct {
DistributionSpec
CACertFilePath string
Insecure bool
Configs []string
Username string
PasswordFromStdin bool
Password string
// contains filtered or unexported fields
}
Remote options struct.
func (*Remote) Credential ¶
func (opts *Remote) Credential() auth.Credential
Credential returns a credential based on the remote options.
func (*Remote) EnableDistributionSpecFlag ¶
func (opts *Remote) EnableDistributionSpecFlag()
EnableDistributionSpecFlag set distribution specification flag as applicable.
func (*Remote) NewRegistry ¶
func (opts *Remote) NewRegistry( registry string, common Common, logger *slog.Logger, ) (reg *remote.Registry, err error)
NewRegistry assembles a oras remote registry.
func (*Remote) NewRepository ¶
func (opts *Remote) NewRepository( reference string, common Common, logger *slog.Logger, ) (repo *remote.Repository, err error)
NewRepository assembles a oras remote repository.
type Target ¶
type Target struct {
Remote
RawReference string
Type string
Reference string // contains tag or digest
// Path contains
// - path to the OCI image layout target, or
// - registry and repository for the remote target
Path string
// contains filtered or unexported fields
}
Target struct contains flags and arguments specifying one registry or image layout.
func (*Target) AnnotatedReference ¶
AnnotatedReference returns full printable reference.
func (*Target) EnsureReferenceNotEmpty ¶
EnsureReferenceNotEmpty ensures whether the tag or digest is empty.
func (*Target) NewReadonlyTarget ¶
func (opts *Target) NewReadonlyTarget( ctx context.Context, common Common, logger *slog.Logger, ) (ReadOnlyGraphTagFinderTarget, error)
NewReadonlyTargets generates a new read only target based on opts.
type Transport ¶
type Transport struct {
http.RoundTripper
}
Transport is an http.RoundTripper that keeps track of the in-flight request and add hooks to report HTTP tracing events.