registry

package
v0.0.0-...-83e6e2d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnknownAPIResponseError = errors.New("API error")
	StatusUnauthorizedError = errors.New("403")
	StatusForbiddenError    = errors.New("401")
	StatusToManyRequests    = errors.New("429")
)

Functions

This section is empty.

Types

type OciAPIClient

type OciAPIClient struct {
	Image OciImage

	http.Client
	// contains filtered or unexported fields
}

OciAPIClient requests a registry of a given Image. If pull secret is nil it will request the registry without basic-auth. The stores a bearer token to avoid unnecessary traffic and registry restrictions of max login. If an API call code is 401 or 403 the client return a PermissionsError, else a ClientAPIError.

func (*OciAPIClient) GetTagsForImage

func (c *OciAPIClient) GetTagsForImage(ctx context.Context, secret OciPullSecret) ([]string, error)

GetTagsForImage for configured client. If secret is nil the request will omit the BasicAuth HTTP header

type OciImage

type OciImage interface {
	GetNameWithoutRegistry() string
	GetRegistryURL() string
}

OciImage is the interface that wraps a Image representation and its required information in a formatted format that the client requires for different kind of API calls

type OciPullSecret

type OciPullSecret interface {
	GetUsername() string
	GetPassword() string
}

OciPullSecret is the interface that wraps a pull secret representation with a username and password.

Jump to

Keyboard shortcuts

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