Documentation ¶
Index ¶
- Constants
- type Cache
- func (cache *Cache) AddManifest(ref *oci.Reference, manifest *ocispec.Descriptor) error
- func (cache *Cache) DeleteReference(ref *oci.Reference) (*CacheRefSummary, error)
- func (cache *Cache) FetchReference(ref *oci.Reference) (*CacheRefSummary, error)
- func (cache *Cache) Ingester() content.Ingester
- func (cache *Cache) ListReferences() ([]*CacheRefSummary, error)
- func (cache *Cache) ProvideIngester() orascontent.ProvideIngester
- func (cache *Cache) Provider() content.Provider
- func (cache *Cache) StoreReference(ref *oci.Reference, m *model.Model) (*CacheRefSummary, error)
- func (cache *Cache) TagReference(ref *oci.Reference, target *oci.Reference) error
- type CacheOption
- type CacheRefSummary
- type Interface
Constants ¶
const (
// CacheRootDir is the root directory for a cache
CacheRootDir = "cache"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache handles local/in-memory storage of Helm charts, compliant with OCI Layout
func (*Cache) AddManifest ¶
AddManifest provides a manifest to the cache index.json.
func (*Cache) DeleteReference ¶
func (cache *Cache) DeleteReference(ref *oci.Reference) (*CacheRefSummary, error)
DeleteReference deletes a chart ref from cache TODO: garbage collection, only manifest removed
func (*Cache) FetchReference ¶
func (cache *Cache) FetchReference(ref *oci.Reference) (*CacheRefSummary, error)
FetchReference retrieves a model ref from cache.
func (*Cache) ListReferences ¶
func (cache *Cache) ListReferences() ([]*CacheRefSummary, error)
ListReferences lists all chart refs in a cache
func (*Cache) ProvideIngester ¶
func (cache *Cache) ProvideIngester() orascontent.ProvideIngester
ProvideIngester provides a valid oras ProvideIngester
func (*Cache) StoreReference ¶
StoreReference stores a model ref in cache
type CacheOption ¶
type CacheOption func(*Cache)
CacheOption allows specifying various settings configurable by the user for overriding the defaults used when creating a new default cache
func CacheOptDebug ¶
func CacheOptDebug(debug bool) CacheOption
CacheOptDebug returns a function that sets the debug setting on cache options set
func CacheOptRoot ¶
func CacheOptRoot(rootDir string) CacheOption
CacheOptRoot returns a function that sets the root directory setting on cache options set
func CacheOptWriter ¶
func CacheOptWriter(out io.Writer) CacheOption
CacheOptWriter returns a function that sets the writer setting on cache options set
type CacheRefSummary ¶
type CacheRefSummary struct { Name string Repo string Tag string Exists bool Manifest *ocispec.Descriptor Config *ocispec.Descriptor ContentLayer *ocispec.Descriptor Size int64 Digest digest.Digest CreatedAt time.Time Model *model.Model }
CacheRefSummary contains as much info as available describing a chart reference in cache Note: fields here are sorted by the order in which they are set in FetchReference method
type Interface ¶
type Interface interface { FetchReference(ref *oci.Reference) (*CacheRefSummary, error) StoreReference(ref *oci.Reference, m *model.Model) (*CacheRefSummary, error) DeleteReference(ref *oci.Reference) (*CacheRefSummary, error) ListReferences() ([]*CacheRefSummary, error) AddManifest(ref *oci.Reference, manifest *ocispec.Descriptor) error TagReference(ref *oci.Reference, target *oci.Reference) error Provider() content.Provider Ingester() content.Ingester ProvideIngester() orascontent.ProvideIngester }
Interface is the interface of the cache.
func New ¶
func New(opts ...CacheOption) (Interface, error)
New returns a new OCI Layout-compliant cache with config