api

package
v0.0.0-...-330ab6c Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginURL

func LoginURL(registryName string) string

LoginURL returns the FQDN for a registry.

func LoginURLWithPrefix

func LoginURLWithPrefix(loginURL string) string

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

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)
}

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)

func (*ORASClient) Annotate

func (o *ORASClient) Annotate(ctx context.Context, reference string, artifactType string, annotationsArg map[string]string) error

func (*ORASClient) DiscoverLifecycleAnnotation

func (o *ORASClient) DiscoverLifecycleAnnotation(ctx context.Context, reference string, artifactType string) (bool, error)

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.

Jump to

Keyboard shortcuts

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