Documentation ¶
Index ¶
- Variables
- func AddEtagToTag(tag, etag string) distribution.ManifestServiceOption
- func HandleErrorResponse(resp *http.Response) errordeprecated
- func HandleHTTPResponseError(resp *http.Response) error
- func NewRepository(name reference.Named, baseURL string, transport http.RoundTripper) (distribution.Repository, error)
- func ReturnContentDigest(dgst *digest.Digest) distribution.ManifestServiceOption
- func SuccessStatus(status int) booldeprecated
- func WithMountFrom(ref reference.Canonical) distribution.BlobCreateOption
- type Registry
- type UnexpectedHTTPResponseError
- type UnexpectedHTTPStatusError
Constants ¶
This section is empty.
Variables ¶
var ErrNoErrorsInBody = errors.New("no error details found in HTTP response body")
ErrNoErrorsInBody is returned when an HTTP response body parses to an empty errcode.Errors slice.
Functions ¶
func AddEtagToTag ¶
func AddEtagToTag(tag, etag string) distribution.ManifestServiceOption
AddEtagToTag allows a client to supply an eTag to Get which will be used for a conditional HTTP request. If the eTag matches, a nil manifest and ErrManifestNotModified error will be returned. etag is automatically quoted when added to this map.
func HandleErrorResponse
deprecated
HandleErrorResponse returns error parsed from HTTP response for an unsuccessful HTTP response code (in the range 400 - 499 inclusive). An UnexpectedHTTPStatusError returned for response code outside of expected range.
Deprecated: use HandleHTTPResponseError and check the error.
func HandleHTTPResponseError ¶
HandleHTTPResponseError returns error parsed from HTTP response, if any. It returns nil if no error occurred (HTTP status 200-399), or an error for unsuccessful HTTP response codes (in the range 400 - 499 inclusive). If possible, it returns a typed error, but an UnexpectedHTTPStatusError is returned for response code outside the expected range (HTTP status < 200 and > 500).
func NewRepository ¶
func NewRepository(name reference.Named, baseURL string, transport http.RoundTripper) (distribution.Repository, error)
NewRepository creates a new Repository for the given repository name and base URL.
func ReturnContentDigest ¶
func ReturnContentDigest(dgst *digest.Digest) distribution.ManifestServiceOption
ReturnContentDigest allows a client to set a the content digest on a successful request from the 'Docker-Content-Digest' header. This returned digest is represents the digest which the registry uses to refer to the content and can be used to delete the content.
func SuccessStatus
deprecated
SuccessStatus returns true if the argument is a successful HTTP response code (in the range 200 - 399 inclusive).
Deprecated: use HandleHTTPResponseError and check the error.
func WithMountFrom ¶
WithMountFrom returns a BlobCreateOption which designates that the blob should be mounted from the given canonical reference.
Types ¶
type Registry ¶
type Registry interface {
Repositories(ctx context.Context, repos []string, last string) (n int, err error)
}
Registry provides an interface for calling Repositories, which returns a catalog of repositories.
func NewRegistry ¶
func NewRegistry(baseURL string, transport http.RoundTripper) (Registry, error)
NewRegistry creates a registry namespace which can be used to get a listing of repositories
type UnexpectedHTTPResponseError ¶
UnexpectedHTTPResponseError is returned when an expected HTTP status code is returned, but the content was unexpected and failed to be parsed.
func (*UnexpectedHTTPResponseError) Error ¶
func (e *UnexpectedHTTPResponseError) Error() string
type UnexpectedHTTPStatusError ¶
type UnexpectedHTTPStatusError struct {
Status string
}
UnexpectedHTTPStatusError is returned when an unexpected HTTP status is returned when making a registry api call.
func (*UnexpectedHTTPStatusError) Error ¶
func (e *UnexpectedHTTPStatusError) Error() string