Documentation ¶
Index ¶
- Constants
- func KnownMediaTypes() []string
- type Authorizer
- type Cache
- func (cache *Cache) AddManifest(ref *Reference, manifest *ocispec.Descriptor) error
- func (cache *Cache) DeleteReference(ref *Reference) (*CacheRefSummary, error)
- func (cache *Cache) FetchReference(ref *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 *Reference, ch *chart.Chart) (*CacheRefSummary, error)
- type CacheOption
- type CacheRefSummary
- type Client
- func (c *Client) LoadChart(ref *Reference) (*chart.Chart, error)
- func (c *Client) Login(hostname string, username string, password string, insecure bool) error
- func (c *Client) Logout(hostname string) error
- func (c *Client) PrintChartTable() error
- func (c *Client) PullChart(ref *Reference) (*bytes.Buffer, error)
- func (c *Client) PullChartToCache(ref *Reference) error
- func (c *Client) PushChart(ref *Reference) error
- func (c *Client) RemoveChart(ref *Reference) error
- func (c *Client) SaveChart(ch *chart.Chart, ref *Reference) error
- type ClientOption
- func ClientOptAuthorizer(authorizer *Authorizer) ClientOption
- func ClientOptCache(cache *Cache) ClientOption
- func ClientOptCredentialsFile(credentialsFile string) ClientOption
- func ClientOptDebug(debug bool) ClientOption
- func ClientOptInsecure(insecure bool) ClientOption
- func ClientOptResolver(resolver *Resolver) ClientOption
- func ClientOptWriter(out io.Writer) ClientOption
- type Reference
- type Resolver
Constants ¶
const ( // HelmChartConfigMediaType is the reserved media type for the Helm chart manifest config HelmChartConfigMediaType = "application/vnd.cncf.helm.config.v1+json" // HelmChartContentLayerMediaType is the reserved media type for Helm chart package content HelmChartContentLayerMediaType = "application/tar+gzip" )
const (
// CacheRootDir is the root directory for a cache
CacheRootDir = "cache"
)
const (
// CredentialsFileBasename is the filename for auth credentials file
CredentialsFileBasename = "config.json"
)
Variables ¶
This section is empty.
Functions ¶
func KnownMediaTypes ¶
func KnownMediaTypes() []string
KnownMediaTypes returns a list of layer mediaTypes that the Helm client knows about
Types ¶
type Authorizer ¶
Authorizer handles registry auth operations
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache handles local/in-memory storage of Helm charts, compliant with OCI Layout
func NewCache ¶
func NewCache(opts ...CacheOption) (*Cache, error)
NewCache returns a new OCI Layout-compliant cache with config
func (*Cache) AddManifest ¶
func (cache *Cache) AddManifest(ref *Reference, manifest *ocispec.Descriptor) error
AddManifest provides a manifest to the cache index.json
func (*Cache) DeleteReference ¶
func (cache *Cache) DeleteReference(ref *Reference) (*CacheRefSummary, error)
DeleteReference deletes a chart ref from cache TODO: garbage collection, only manifest removed
func (*Cache) FetchReference ¶
func (cache *Cache) FetchReference(ref *Reference) (*CacheRefSummary, error)
FetchReference retrieves a chart 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 chart 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 Chart *chart.Chart }
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 Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client works with OCI-compliant registries and local Helm chart cache
func NewClient ¶
func NewClient(opts ...ClientOption) (*Client, error)
NewClient returns a new registry client with config
func (*Client) PrintChartTable ¶
PrintChartTable prints a list of locally stored charts
func (*Client) PullChartToCache ¶
PullChartToCache pulls a chart from an OCI Registry to the Registry Cache. This function is needed for `helm chart pull`, which is experimental and will be deprecated soon. Likewise, the Registry cache will soon be deprecated as will this function.
func (*Client) RemoveChart ¶
RemoveChart deletes a locally saved chart
type ClientOption ¶
type ClientOption func(*Client)
ClientOption allows specifying various settings configurable by the user for overriding the defaults used when creating a new default client
func ClientOptAuthorizer ¶
func ClientOptAuthorizer(authorizer *Authorizer) ClientOption
ClientOptAuthorizer returns a function that sets the authorizer setting on client options set
func ClientOptCache ¶
func ClientOptCache(cache *Cache) ClientOption
ClientOptCache returns a function that sets the cache setting on a client options set
func ClientOptCredentialsFile ¶
func ClientOptCredentialsFile(credentialsFile string) ClientOption
ClientOptCredentialsFile returns a function that sets the cache setting on a client options set
func ClientOptDebug ¶
func ClientOptDebug(debug bool) ClientOption
ClientOptDebug returns a function that sets the debug setting on client options set
func ClientOptInsecure ¶
func ClientOptInsecure(insecure bool) ClientOption
func ClientOptResolver ¶
func ClientOptResolver(resolver *Resolver) ClientOption
ClientOptResolver returns a function that sets the resolver setting on client options set
func ClientOptWriter ¶
func ClientOptWriter(out io.Writer) ClientOption
ClientOptWriter returns a function that sets the writer setting on client options set
type Reference ¶
Reference defines the main components of a reference specification
func ParseReference ¶
ParseReference converts a string to a Reference