Documentation ¶
Index ¶
- Constants
- func ContainsTag(tags []string, tag string) bool
- func GetTagMatchingVersionOrConstraint(tags []string, versionString string) (string, error)
- func IsOCI(url string) bool
- type Client
- func (c *Client) Login(host string, options ...LoginOption) error
- func (c *Client) Logout(host string, opts ...LogoutOption) error
- func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error)
- func (c *Client) Push(data []byte, ref string, options ...PushOption) (*PushResult, error)
- func (c *Client) Tags(ref string) ([]string, error)
- type ClientOption
- func ClientOptCredentialsFile(credentialsFile string) ClientOption
- func ClientOptDebug(debug bool) ClientOption
- func ClientOptEnableCache(enableCache bool) ClientOption
- func ClientOptHTTPClient(httpClient *http.Client) ClientOption
- func ClientOptPlainHTTP() ClientOption
- func ClientOptResolver(resolver remotes.Resolver) ClientOption
- func ClientOptWriter(out io.Writer) ClientOption
- type DescriptorPullSummary
- type DescriptorPullSummaryWithMeta
- type LoginOption
- type LogoutOption
- type PullOption
- type PullResult
- type PushOption
- type PushResult
Constants ¶
const ( // OCIScheme is the URL scheme for OCI-based requests OCIScheme = "oci" // CredentialsFileBasename is the filename for auth credentials file CredentialsFileBasename = "registry/config.json" // ConfigMediaType is the reserved media type for the Helm chart manifest config ConfigMediaType = "application/vnd.cncf.helm.config.v1+json" // ChartLayerMediaType is the reserved media type for Helm chart package content ChartLayerMediaType = "application/vnd.cncf.helm.chart.content.v1.tar+gzip" // ProvLayerMediaType is the reserved media type for Helm chart provenance files ProvLayerMediaType = "application/vnd.cncf.helm.chart.provenance.v1.prov" // LegacyChartLayerMediaType is the legacy reserved media type for Helm chart package content. LegacyChartLayerMediaType = "application/tar+gzip" )
Variables ¶
This section is empty.
Functions ¶
func ContainsTag ¶
ContainsTag determines whether a tag is found in a provided list of tags
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client works with OCI-compliant registries
func NewClient ¶
func NewClient(options ...ClientOption) (*Client, error)
NewClient returns a new registry client with config
func NewRegistryClientWithTLS ¶ added in v3.12.0
func NewRegistryClientWithTLS(out io.Writer, certFile, keyFile, caFile string, insecureSkipTLSverify bool, registryConfig string, debug bool) (*Client, error)
NewRegistryClientWithTLS is a helper function to create a new registry client with TLS enabled.
func (*Client) Login ¶
func (c *Client) Login(host string, options ...LoginOption) error
Login logs into a registry
func (*Client) Logout ¶
func (c *Client) Logout(host string, opts ...LogoutOption) error
Logout logs out of a registry
func (*Client) Pull ¶
func (c *Client) Pull(ref string, options ...PullOption) (*PullResult, error)
Pull downloads a chart from a registry
func (*Client) Push ¶
func (c *Client) Push(data []byte, ref string, options ...PushOption) (*PushResult, error)
Push uploads a chart to a registry.
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 ClientOptCredentialsFile ¶
func ClientOptCredentialsFile(credentialsFile string) ClientOption
ClientOptCredentialsFile returns a function that sets the credentialsFile 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 ClientOptEnableCache ¶ added in v3.9.1
func ClientOptEnableCache(enableCache bool) ClientOption
ClientOptEnableCache returns a function that sets the enableCache setting on a client options set
func ClientOptHTTPClient ¶ added in v3.12.0
func ClientOptHTTPClient(httpClient *http.Client) ClientOption
ClientOptHTTPClient returns a function that sets the httpClient setting on a client options set
func ClientOptPlainHTTP ¶ added in v3.13.0
func ClientOptPlainHTTP() ClientOption
func ClientOptResolver ¶ added in v3.13.0
func ClientOptResolver(resolver remotes.Resolver) ClientOption
ClientOptResolver returns a function that sets the resolver setting on a 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 DescriptorPullSummary ¶ added in v3.13.0
type DescriptorPullSummaryWithMeta ¶ added in v3.13.0
type DescriptorPullSummaryWithMeta struct { DescriptorPullSummary Meta *chart.Metadata `json:"meta"` }
type LoginOption ¶
type LoginOption func(*loginOperation)
LoginOption allows specifying various settings on login
func LoginOptBasicAuth ¶
func LoginOptBasicAuth(username string, password string) LoginOption
LoginOptBasicAuth returns a function that sets the username/password settings on login
func LoginOptInsecure ¶
func LoginOptInsecure(insecure bool) LoginOption
LoginOptInsecure returns a function that sets the insecure setting on login
func LoginOptTLSClientConfig ¶ added in v3.12.0
func LoginOptTLSClientConfig(certFile, keyFile, caFile string) LoginOption
LoginOptTLSClientConfig returns a function that sets the TLS settings on login.
type LogoutOption ¶
type LogoutOption func(*logoutOperation)
LogoutOption allows specifying various settings on logout
type PullOption ¶
type PullOption func(*pullOperation)
PullOption allows specifying various settings on pull
func PullOptIgnoreMissingProv ¶
func PullOptIgnoreMissingProv(ignoreMissingProv bool) PullOption
PullOptIgnoreMissingProv returns a function that sets the ignoreMissingProv setting on pull
func PullOptWithChart ¶
func PullOptWithChart(withChart bool) PullOption
PullOptWithChart returns a function that sets the withChart setting on pull
func PullOptWithProv ¶
func PullOptWithProv(withProv bool) PullOption
PullOptWithProv returns a function that sets the withProv setting on pull
type PullResult ¶
type PullResult struct { Manifest *DescriptorPullSummary `json:"manifest"` Config *DescriptorPullSummary `json:"config"` Chart *DescriptorPullSummaryWithMeta `json:"chart"` Prov *DescriptorPullSummary `json:"prov"` Ref string `json:"ref"` }
PullResult is the result returned upon successful pull.
type PushOption ¶
type PushOption func(*pushOperation)
PushOption allows specifying various settings on push
func PushOptCreationTime ¶ added in v3.15.0
func PushOptCreationTime(creationTime string) PushOption
PushOptCreationDate returns a function that sets the creation time
func PushOptProvData ¶
func PushOptProvData(provData []byte) PushOption
PushOptProvData returns a function that sets the prov bytes setting on push
func PushOptStrictMode ¶
func PushOptStrictMode(strictMode bool) PushOption
PushOptStrictMode returns a function that sets the strictMode setting on push
type PushResult ¶
type PushResult struct { Manifest *descriptorPushSummary `json:"manifest"` Config *descriptorPushSummary `json:"config"` Chart *descriptorPushSummaryWithMeta `json:"chart"` Prov *descriptorPushSummary `json:"prov"` Ref string `json:"ref"` }
PushResult is the result returned upon successful push.