Documentation ¶
Index ¶
- func DefaultOptions() []crane.Option
- func GetAuthFromCredentials(credentials string) (authn.Authenticator, error)
- func ParseArtifactURL(ociURL string) (string, error)
- func ParseRepositoryURL(ociURL string) (string, error)
- func WithRetryBackOff(backoff remote.Backoff) crane.Option
- func WithRetryTransport(ctx context.Context, ref name.Reference, auth authn.Authenticator, ...) (crane.Option, error)
- type Client
- func (c *Client) Build(artifactPath, sourceDir string, ignorePaths []string) (err error)
- func (c *Client) Delete(ctx context.Context, url string) error
- func (c *Client) Diff(ctx context.Context, url, dir string, ignorePaths []string) error
- func (c *Client) GetOptions() []crane.Option
- func (c *Client) List(ctx context.Context, url string, opts ListOptions) ([]Metadata, error)
- func (c *Client) LoginWithCredentials(credentials string) error
- func (c *Client) LoginWithProvider(ctx context.Context, url string, provider oci.Provider) error
- func (c *Client) Pull(ctx context.Context, url, outDir string) (*Metadata, error)
- func (c *Client) Push(ctx context.Context, url, sourceDir string, meta Metadata, ...) (string, error)
- func (c *Client) Tag(ctx context.Context, url, tag string) (string, error)
- type ListOptions
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultOptions ¶ added in v0.24.0
DefaultOptions returns an array containing crane.WithPlatform to set the platform to flux.
func GetAuthFromCredentials ¶ added in v0.27.0
func GetAuthFromCredentials(credentials string) (authn.Authenticator, error)
GetAuthFromCredentials returns an authn.Authenticator for the static credentials, accepts a single token or a user:password format.
func ParseArtifactURL ¶
ParseArtifactURL validates the OCI URL and returns the address of the artifact.
func ParseRepositoryURL ¶
ParseRepositoryURL validates the OCI URL and returns the address of the artifact repository.
func WithRetryBackOff ¶ added in v0.24.0
WithRetryBackOff returns a function for setting the given backoff on crane.Option.
func WithRetryTransport ¶ added in v0.27.0
func WithRetryTransport(ctx context.Context, ref name.Reference, auth authn.Authenticator, backoff remote.Backoff, scopes []string) (crane.Option, error)
WithRetryTransport returns a crane.Option for setting transport that uses the backoff for retries
Most parts(including the functions below) are copied from https://github.com/google/go-containerregistry/blob/v0.14.0/pkg/v1/remote/options.go#L152 so we have the same transport used in the library but with a different retry backoff.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the options for accessing remote OCI registries.
func (*Client) Build ¶
Build archives the given directory as a tarball to the given local path. While archiving, any environment specific data (for example, the user and group name) is stripped from file headers.
func (*Client) Delete ¶ added in v0.6.0
Delete deletes a particular image from an OCI repository If the url has no tag, the latest image is deleted
func (*Client) Diff ¶ added in v0.14.0
Diff compares the files included in an OCI image with the local files in the given path and returns an error if the contents is different
func (*Client) GetOptions ¶ added in v0.23.0
GetOptions returns the list of crane.Option used by this Client.
func (*Client) LoginWithCredentials ¶ added in v0.9.0
LoginWithCredentials configures the client with static credentials, accepts a single token or a user:password format.
func (*Client) LoginWithProvider ¶ added in v0.9.0
LoginWithProvider configures the client to log in to the specified provider
func (*Client) Pull ¶
Pull downloads an artifact from an OCI repository and extracts the content to the given directory.
type ListOptions ¶ added in v0.5.0
type ListOptions struct { // SemverFilter contains semver for filtering tags. SemverFilter string // RegexFilter contains a regex that tags will be filtered by. RegexFilter string }
ListOptions contains options for listing tags from an OCI repository.
type Metadata ¶
type Metadata struct { Created string `json:"created"` Source string `json:"source_url"` Revision string `json:"source_revision"` Digest string `json:"digest"` URL string `json:"url"` Annotations map[string]string `json:"annotations,omitempty"` }
Metadata holds the upstream information about on artifact's source. https://github.com/opencontainers/image-spec/blob/main/annotations.md
func MetadataFromAnnotations ¶
MetadataFromAnnotations parses the OpenContainers annotations and returns a Metadata object.
func (*Metadata) ToAnnotations ¶
ToAnnotations returns the OpenContainers annotations map.