Documentation
¶
Index ¶
- type Containerd
- func (d *Containerd) Context() context.Context
- func (d *Containerd) Exists(ctx context.Context, desc ocispec.Descriptor) (bool, error)
- func (d *Containerd) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)
- func (d *Containerd) Finalize(ctx context.Context) error
- func (d *Containerd) Push(ctx context.Context, expected ocispec.Descriptor, r io.Reader) error
- func (d *Containerd) Resolve(ctx context.Context, ref string) (ocispec.Descriptor, error)
- func (d *Containerd) Tag(ctx context.Context, desc ocispec.Descriptor, ref string) error
- func (d *Containerd) Target(_ context.Context, _ string) (oras.Target, error)
- type Directory
- type Registry
- type RegistryOpt
- type Resolver
- type ResolverCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Containerd ¶
type Containerd struct {
// contains filtered or unexported fields
}
Containerd resolver to push to/pull from containerd. Finalize releases the lease taken when the resolver was created, so a Containerd is good for one unit of work and should be discarded afterwards.
func NewContainerd ¶
func NewContainerd(ctx context.Context, address, namespace string) (context.Context, *Containerd, error)
NewContainerd create a containerd resolver given the containerd address and namespace (optional)
func NewContainerdWithClient ¶
func NewContainerdWithClient(ctx context.Context, client *containerd.Client) (context.Context, *Containerd, error)
NewContainerdWithClient create a containerd resolver with an existing containerd client connection
func (*Containerd) Context ¶
func (d *Containerd) Context() context.Context
func (*Containerd) Exists ¶
func (d *Containerd) Exists(ctx context.Context, desc ocispec.Descriptor) (bool, error)
Exists report whether the content named by desc is already in the store.
func (*Containerd) Fetch ¶
func (d *Containerd) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)
Fetch return a reader for the content named by desc.
func (*Containerd) Push ¶
func (d *Containerd) Push(ctx context.Context, expected ocispec.Descriptor, r io.Reader) error
Push write the content to the store. A manifest or index is also given the containerd GC labels that keep its children from being collected; without them containerd is free to remove blobs this manifest still references.
func (*Containerd) Resolve ¶
func (d *Containerd) Resolve(ctx context.Context, ref string) (ocispec.Descriptor, error)
Resolve look up the image by reference and return the descriptor it points at.
func (*Containerd) Tag ¶
func (d *Containerd) Tag(ctx context.Context, desc ocispec.Descriptor, ref string) error
Tag point the given reference at desc, creating the image if it is not there yet.
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
Directory resolver that reads and writes an OCI image layout in a directory.
func NewDirectory ¶
NewDirectory create a Directory resolver over dir, creating it if needed.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry resolver that reads and writes an OCI registry.
func NewRegistry ¶
NewRegistry create a Registry resolver that reaches the registry over HTTPS.
func NewRegistryWithOpts ¶
func NewRegistryWithOpts(ctx context.Context, opts ...RegistryOpt) (context.Context, *Registry, error)
NewRegistryWithOpts create a Registry resolver configured by opts.
type RegistryOpt ¶
type RegistryOpt func(*registryOpts)
RegistryOpt configures a Registry created by NewRegistryWithOpts.
func WithPlainHTTP ¶
func WithPlainHTTP() RegistryOpt
WithPlainHTTP directs the resolver to contact the registry over HTTP rather than HTTPS, for a registry served without TLS such as a lab-local or test registry.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver serves a target the caller already holds.
func NewResolver ¶
NewResolver create a Resolver that hands out the given target for every reference.
type ResolverCloser ¶
type ResolverCloser interface {
// Target returns the target that reads and writes the given reference.
Target(ctx context.Context, ref string) (oras.Target, error)
// Context returns the context the resolver was created with.
Context() context.Context
// Finalize releases anything the resolver is holding, such as a lease.
Finalize(ctx context.Context) error
}
ResolverCloser hands out oras targets for references and releases whatever it holds when done. One ResolverCloser can serve several references; Target is what binds it to a particular one, because an oras target addresses a single repository.