Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotOCI = errors.New("distribution: registry isn't OCI-compliant") ErrManifestNotExist = errors.New("distribution: manifest does not exist") ErrBlobNotExist = errors.New("distribution: blob does not exist") ErrParseBody = errors.New("distribtuion: could not read response body") ErrParseJSON = errors.New("distribution: could not parse JSON") ErrUnknownMediaType = errors.New("distribution: unknown media type") ErrSchemaValidation = errors.New("distribution: unable to validate schema") ErrInvalidIndex = errors.New("distribution: registry returned invalid index") ErrInvalidManifest = errors.New("distribution: registry returned invalid manifest") )
var DefaultTransport = http.Transport{ResponseHeaderTimeout: time.Second}
DefaultTransport is the optional transport clients may use. Requests to the registry timeout after one second.
var ErrInvalidSchema = "distribution: invalid schema"
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
Authenticator is the interface all auth methods must satisfy.
type BasicAuth ¶
BasicAuth is an implementation of the Authenticator interface for username/password authentication.
type Client ¶
type Client struct {
Transport http.RoundTripper
}
Client is an implementation of http.RoundTripper.
type Config ¶
type Config struct {
Transport http.RoundTripper
}
Config defines the parameters for Client configuration.
type DistributionAPI ¶
type DistributionAPI struct {
// contains filtered or unexported fields
}
DistributionAPI contains methods for interacting with a remote registry.
func NewDistributionAPI ¶
func NewDistributionAPI(c *Client) *DistributionAPI
NewDistributionAPI returns a fully initialized API for interacting with a remote registry.
func (*DistributionAPI) NewRegistry ¶
func (api *DistributionAPI) NewRegistry(host string, auth *Authenticator) *Registry
NewRegistry returns a fully initialized Registry.
func (*DistributionAPI) Verify ¶
func (api *DistributionAPI) Verify() error
Verify verifies that the registry is OCI-compliant.
func (*DistributionAPI) VerifyBlob ¶
func (api *DistributionAPI) VerifyBlob( repo string, digest digest.Digest) error
VerifyBlob confirms the existance of a manifest in a remote registry.
type ErrorResponse ¶
type ErrorResponse struct {
Errors []ErrorInfo `json:"errors"`
}
func (*ErrorResponse) Detail ¶
func (er *ErrorResponse) Detail() []ErrorInfo
func (*ErrorResponse) Error ¶
func (er *ErrorResponse) Error() string
Error satisfies the Error interface.
type Registry ¶
type Registry struct { Host *url.URL Auth Authenticator // contains filtered or unexported fields }
Registry represents a remote OCI-compliant registries.
func (*Registry) GetManifests ¶
GetManifests returns an image index and a slice of manifests from a remote registry. If the manifest is an Image Index, all manifests referenced in the index will be downloaded and returned. If a nil Index is returned, there will only be one manifest in the slice.
func (*Registry) ManifestExists ¶
ManifestExists confirms the existance of a manifest in a remote registry.
type TokenAuth ¶
type TokenAuth struct {
Token string
}
TokenAuth is an implementation of the Authenticator interface for token authentication.
type ValidationError ¶
type ValidationError []gojsonschema.ResultError
func (*ValidationError) Error ¶
func (ve *ValidationError) Error() string