Documentation
¶
Index ¶
- func NewLocalProvider(cfg *config.Config, platformMC platforms.MatchComparer) (Provider, *Content, error)
- type Content
- func (content *Content) Abort(ctx context.Context, ref string) error
- func (content *Content) Delete(ctx context.Context, dgst digest.Digest) error
- func (content *Content) GC(ctx context.Context, threshold int64)
- func (content *Content) Info(ctx context.Context, dgst digest.Digest) (ctrcontent.Info, error)
- func (content *Content) ListStatuses(ctx context.Context, filters ...string) ([]ctrcontent.Status, error)
- func (content *Content) NewRemoteCache(cacheRef string) error
- func (content *Content) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (ctrcontent.ReaderAt, error)
- func (content *Content) Size() (int64, error)
- func (content *Content) Status(ctx context.Context, ref string) (ctrcontent.Status, error)
- func (content *Content) Update(ctx context.Context, info ctrcontent.Info, fieldpaths ...string) (ctrcontent.Info, error)
- func (content *Content) Walk(ctx context.Context, fn ctrcontent.WalkFunc, fs ...string) error
- func (content *Content) Writer(ctx context.Context, opts ...ctrcontent.WriterOpt) (ctrcontent.Writer, error)
- type LocalProvider
- func (pvd *LocalProvider) ContentStore() content.Store
- func (pvd *LocalProvider) GetCacheRef() string
- func (pvd *LocalProvider) Image(ctx context.Context, ref string) (*ocispec.Descriptor, error)
- func (pvd *LocalProvider) Pull(ctx context.Context, ref string) error
- func (pvd *LocalProvider) Push(ctx context.Context, desc ocispec.Descriptor, ref string) error
- func (pvd *LocalProvider) Resolver(ref string) (remotes.Resolver, error)
- func (pvd *LocalProvider) SetCacheRef(ref string)
- func (pvd *LocalProvider) UsePlainHTTP()
- type Provider
- type RemoteCache
- func (rc *RemoteCache) Add(key string, value ocispec.Descriptor)
- func (rc *RemoteCache) Get(key string) (ocispec.Descriptor, bool)
- func (rc *RemoteCache) NewLRUCache(cacheSize int, cacheRef string) error
- func (rc *RemoteCache) Remove(key string)
- func (rc *RemoteCache) Size() int
- func (rc *RemoteCache) Values() []ocispec.Descriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLocalProvider ¶
Types ¶
type Content ¶ added in v0.2.5
type Content struct {
// GcMutex works between gc and convert
GcMutex *sync.RWMutex
// Threshold is the maximum capacity of the local caches storage
Threshold int64
// contains filtered or unexported fields
}
func NewContent ¶ added in v0.2.5
func NewContent(contentDir string, databaseDir string, threshold string, useRemoteCache bool, cacheSize int, host remote.HostFunc) (*Content, error)
NewContent return content support by content store, bolt database and threshold. content store created in contentDir and bolt database created in databaseDir. content.db supported by bolt database and content store, content.lm supported by content.db.
func (*Content) GC ¶ added in v0.2.5
GC clean the local caches by cfg.Provider.GCPolicy configuration
func (*Content) ListStatuses ¶ added in v0.2.6
func (*Content) NewRemoteCache ¶ added in v0.2.7
func (*Content) ReaderAt ¶ added in v0.2.6
func (content *Content) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (ctrcontent.ReaderAt, error)
func (*Content) Update ¶ added in v0.2.6
func (content *Content) Update(ctx context.Context, info ctrcontent.Info, fieldpaths ...string) (ctrcontent.Info, error)
func (*Content) Writer ¶ added in v0.2.6
func (content *Content) Writer(ctx context.Context, opts ...ctrcontent.WriterOpt) (ctrcontent.Writer, error)
type LocalProvider ¶
type LocalProvider struct {
// contains filtered or unexported fields
}
func (*LocalProvider) ContentStore ¶
func (pvd *LocalProvider) ContentStore() content.Store
func (*LocalProvider) GetCacheRef ¶ added in v0.2.7
func (pvd *LocalProvider) GetCacheRef() string
func (*LocalProvider) Image ¶
func (pvd *LocalProvider) Image(ctx context.Context, ref string) (*ocispec.Descriptor, error)
func (*LocalProvider) Push ¶
func (pvd *LocalProvider) Push(ctx context.Context, desc ocispec.Descriptor, ref string) error
func (*LocalProvider) Resolver ¶
func (pvd *LocalProvider) Resolver(ref string) (remotes.Resolver, error)
func (*LocalProvider) SetCacheRef ¶ added in v0.2.7
func (pvd *LocalProvider) SetCacheRef(ref string)
func (*LocalProvider) UsePlainHTTP ¶ added in v0.1.1
func (pvd *LocalProvider) UsePlainHTTP()
type Provider ¶
type Provider interface {
// Use plain HTTP to communicate with registry.
UsePlainHTTP()
// Resolve attempts to resolve the reference into a name and descriptor.
Resolver(ref string) (remotes.Resolver, error)
// Pull pulls source image from remote registry by specified reference.
// This pulls all platforms of the image but Image() returns containerd.Image for
// the default platform.
Pull(ctx context.Context, ref string) error
// Push pushes target image to remote registry by specified reference,
// the desc parameter represents the manifest of targe image.
Push(ctx context.Context, desc ocispec.Descriptor, ref string) error
// Image gets the source image descriptor.
Image(ctx context.Context, ref string) (*ocispec.Descriptor, error)
// ContentStore gets the content store object of containerd.
ContentStore() content.Store
// SetCacheRef sets the cache reference of the source image.
SetCacheRef(ref string)
// GetCacheRef gets the cache reference of the source image.
GetCacheRef() string
}
Provider provides necessary image utils, image content store for image conversion.
type RemoteCache ¶ added in v0.2.7
type RemoteCache struct {
// contains filtered or unexported fields
}
func NewRemoteCache ¶ added in v0.2.7
func NewRemoteCache(cacheSize int, host remote.HostFunc) (*RemoteCache, error)
func (*RemoteCache) Add ¶ added in v0.2.7
func (rc *RemoteCache) Add(key string, value ocispec.Descriptor)
func (*RemoteCache) Get ¶ added in v0.2.7
func (rc *RemoteCache) Get(key string) (ocispec.Descriptor, bool)
func (*RemoteCache) NewLRUCache ¶ added in v0.2.7
func (rc *RemoteCache) NewLRUCache(cacheSize int, cacheRef string) error
func (*RemoteCache) Remove ¶ added in v0.2.7
func (rc *RemoteCache) Remove(key string)
func (*RemoteCache) Size ¶ added in v0.2.7
func (rc *RemoteCache) Size() int
Size returns the number of items in the cache.
func (*RemoteCache) Values ¶ added in v0.2.7
func (rc *RemoteCache) Values() []ocispec.Descriptor
Click to show internal directories.
Click to hide internal directories.