Documentation
¶
Overview ¶
Package api provides client implementations for Azure Container Registry and ORAS operations.
Index ¶
- func LoginURL(registryName string) string
- func LoginURLWithPrefix(loginURL string) string
- type AcrCLIClient
- func (c *AcrCLIClient) DeleteAcrTag(ctx context.Context, repoName string, reference string) (*autorest.Response, error)
- func (c *AcrCLIClient) DeleteManifest(ctx context.Context, repoName string, reference string) (*autorest.Response, error)
- func (c *AcrCLIClient) GetAcrManifestAttributes(ctx context.Context, repoName string, reference string) (*acrapi.ManifestAttributes, error)
- func (c *AcrCLIClient) GetAcrManifests(ctx context.Context, repoName string, orderBy string, last string) (*acrapi.Manifests, error)
- func (c *AcrCLIClient) GetAcrTags(ctx context.Context, repoName string, orderBy string, last string) (*acrapi.RepositoryTagsType, error)
- func (c *AcrCLIClient) GetManifest(ctx context.Context, repoName string, reference string) ([]byte, error)
- func (c *AcrCLIClient) UpdateAcrManifestAttributes(ctx context.Context, repoName string, reference string, ...) (*autorest.Response, error)
- func (c *AcrCLIClient) UpdateAcrTagAttributes(ctx context.Context, repoName string, reference string, ...) (*autorest.Response, error)
- type AcrCLIClientInterface
- type GraphTarget
- type ORASClient
- type ORASClientInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoginURLWithPrefix ¶
LoginURLWithPrefix return the hostname of a registry.
Types ¶
type AcrCLIClient ¶
type AcrCLIClient struct {
AutorestClient acrapi.BaseClient
// contains filtered or unexported fields
}
The AcrCLIClient is the struct that will be in charge of doing the http requests to the registry. it implements the AcrCLIClientInterface.
func GetAcrCLIClientWithAuth ¶
func GetAcrCLIClientWithAuth(loginURL string, username string, password string, configs []string) (*AcrCLIClient, error)
GetAcrCLIClientWithAuth obtains a client that has authentication for making ACR http requests
func (*AcrCLIClient) DeleteAcrTag ¶
func (c *AcrCLIClient) DeleteAcrTag(ctx context.Context, repoName string, reference string) (*autorest.Response, error)
DeleteAcrTag deletes the tag by reference.
func (*AcrCLIClient) DeleteManifest ¶
func (c *AcrCLIClient) DeleteManifest(ctx context.Context, repoName string, reference string) (*autorest.Response, error)
DeleteManifest deletes a manifest using the digest as a reference.
func (*AcrCLIClient) GetAcrManifestAttributes ¶
func (c *AcrCLIClient) GetAcrManifestAttributes(ctx context.Context, repoName string, reference string) (*acrapi.ManifestAttributes, error)
GetAcrManifestAttributes gets the attributes of a manifest.
func (*AcrCLIClient) GetAcrManifests ¶
func (c *AcrCLIClient) GetAcrManifests(ctx context.Context, repoName string, orderBy string, last string) (*acrapi.Manifests, error)
GetAcrManifests list all the manifest in a repository with their attributes.
func (*AcrCLIClient) GetAcrTags ¶
func (c *AcrCLIClient) GetAcrTags(ctx context.Context, repoName string, orderBy string, last string) (*acrapi.RepositoryTagsType, error)
GetAcrTags list the tags of a repository with their attributes.
func (*AcrCLIClient) GetManifest ¶
func (c *AcrCLIClient) GetManifest(ctx context.Context, repoName string, reference string) ([]byte, error)
GetManifest fetches a manifest (could be a Manifest List or a v2 manifest) and returns it as a byte array. This is used when a manifest list is wanted, first the bytes are obtained and then unmarshalled into a new struct.
func (*AcrCLIClient) UpdateAcrManifestAttributes ¶
func (c *AcrCLIClient) UpdateAcrManifestAttributes(ctx context.Context, repoName string, reference string, value *acrapi.ChangeableAttributes) (*autorest.Response, error)
UpdateAcrManifestAttributes updates manifest attributes to enable/disable deletion and writing.
func (*AcrCLIClient) UpdateAcrTagAttributes ¶
func (c *AcrCLIClient) UpdateAcrTagAttributes(ctx context.Context, repoName string, reference string, value *acrapi.ChangeableAttributes) (*autorest.Response, error)
UpdateAcrTagAttributes updates tag attributes to enable/disable deletion and writing.
type AcrCLIClientInterface ¶
type AcrCLIClientInterface interface {
GetAcrTags(ctx context.Context, repoName string, orderBy string, last string) (*acrapi.RepositoryTagsType, error)
DeleteAcrTag(ctx context.Context, repoName string, reference string) (*autorest.Response, error)
GetAcrManifests(ctx context.Context, repoName string, orderBy string, last string) (*acrapi.Manifests, error)
DeleteManifest(ctx context.Context, repoName string, reference string) (*autorest.Response, error)
GetManifest(ctx context.Context, repoName string, reference string) ([]byte, error)
GetAcrManifestAttributes(ctx context.Context, repoName string, reference string) (*acrapi.ManifestAttributes, error)
UpdateAcrTagAttributes(ctx context.Context, repoName string, reference string, value *acrapi.ChangeableAttributes) (*autorest.Response, error)
UpdateAcrManifestAttributes(ctx context.Context, repoName string, reference string, value *acrapi.ChangeableAttributes) (*autorest.Response, error)
}
AcrCLIClientInterface defines the required methods that the acr-cli will need to use.
type GraphTarget ¶
type GraphTarget interface {
oras.GraphTarget
io.Closer
Prompt(desc ocispec.Descriptor, prompt string) error
Inner() oras.GraphTarget
}
GraphTarget is a tracked oras.GraphTarget.
type ORASClient ¶
type ORASClient struct {
// contains filtered or unexported fields
}
The ORASClient wraps the oras-go sdk and is used for interacting with artifacts in a registry. it implements the ORASClientInterface.
func GetORASClientWithAuth ¶
func GetORASClientWithAuth(username string, password string, configs []string) (*ORASClient, error)
GetORASClientWithAuth creates an ORAS client with authentication credentials.
func (*ORASClient) Annotate ¶
func (o *ORASClient) Annotate(ctx context.Context, reference string, artifactType string, annotationsArg map[string]string) error
Annotate adds annotations to a manifest at the given reference.
func (*ORASClient) DiscoverLifecycleAnnotation ¶
func (o *ORASClient) DiscoverLifecycleAnnotation(ctx context.Context, reference string, artifactType string) (bool, error)
DiscoverLifecycleAnnotation checks if the given reference has lifecycle annotation support.
type ORASClientInterface ¶
type ORASClientInterface interface {
Annotate(ctx context.Context, reference string, artifactType string, annotations map[string]string) error
DiscoverLifecycleAnnotation(ctx context.Context, reference string, artifactType string) (bool, error)
}
ORASClientInterface defines the required methods that the acr-cli will need to use with ORAS.