Documentation ¶
Index ¶
- func ParseArtifactURL(ociURL string) (string, error)
- func ParseRepositoryURL(ociURL string) (string, error)
- type Client
- func (c *Client) Build(artifactPath, sourceDir string) (err error)
- func (c *Client) List(ctx context.Context, url string) ([]Metadata, 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 Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the options for accessing remote OCI registries.
func NewLocalClient ¶
func NewLocalClient() *Client
NewLocalClient returns an OCI client configured with the Docker keychain helpers.
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) Pull ¶
Pull downloads an artifact from an OCI repository and extracts the content to the given directory.
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"` }
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.