registry

package
v3.10.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
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

func ContainsTag(tags []string, tag string) bool

ContainsTag determines whether a tag is found in a provided list of tags

func GetTagMatchingVersionOrConstraint

func GetTagMatchingVersionOrConstraint(tags []string, versionString string) (string, error)

func IsOCI

func IsOCI(url string) bool

IsOCI determines whether or not a URL is to be treated as an OCI URL

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 (*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.

func (*Client) Tags

func (c *Client) Tags(ref string) ([]string, error)

Tags provides a sorted list all semver compliant tags for a given repository

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

func ClientOptEnableCache(enableCache bool) ClientOption

ClientOptEnableCache returns a function that sets the enableCache 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 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

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 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL