Documentation ¶
Index ¶
- Variables
- func Log(format string, args ...interface{})
- func Quiet(format string, args ...interface{})
- func WrapTransport(transport http.RoundTripper, url, username, password string) http.RoundTripper
- type AuthorizationChallenge
- type BasicTransport
- type ErrorTransport
- type HttpStatusError
- type LogfCallback
- type Registry
- func (registry *Registry) CheckManifest(repository, reference string) error
- func (registry *Registry) DeleteManifest(repository string, digest digest.Digest) error
- func (registry *Registry) Manifest(repository, reference string) (*manifestV1.SignedManifest, error)
- func (registry *Registry) ManifestDigest(repository, reference string) (digest.Digest, error)
- func (registry *Registry) ManifestV2(repository, reference string) (*manifestV2.DeserializedManifest, error)
- func (r *Registry) Ping() error
- func (registry *Registry) PutManifest(repository, reference string, signedManifest *manifestV1.SignedManifest) error
- func (registry *Registry) Repositories() ([]string, error)
- func (registry *Registry) Tags(repository string) (tags []string, err error)
- type TokenTransport
Constants ¶
This section is empty.
Variables ¶
var ( ErrRegistryNotFound = errors.New("registry not found") // ErrRepositoryNotFound means the repository can not be found. ErrRepositoryNotFound = errors.New("repository not found") ErrManifestNotFound = errors.New("manifest not found") ErrOperationIsUnsupported = errors.New("The operation is unsupported") )
registry error
var (
ErrNoMorePages = errors.New("No more pages")
)
Functions ¶
func Log ¶
func Log(format string, args ...interface{})
Log print log
- Pass log messages along to Go's "log" module.
func Quiet ¶
func Quiet(format string, args ...interface{})
Quiet Quiet
- Discard log messages silently.
func WrapTransport ¶
func WrapTransport(transport http.RoundTripper, url, username, password string) http.RoundTripper
WrapTransport returns an existing http.RoundTripper such as http.DefaultTransport, build the transport stack necessary to authenticate to the Docker registry API. This adds in support for OAuth bearer tokens and HTTP Basic auth, and sets up error handling this library relies on.
Types ¶
type AuthorizationChallenge ¶
AuthorizationChallenge carries information from a WWW-Authenticate response header.
type BasicTransport ¶
type BasicTransport struct { Transport http.RoundTripper URL string Username string Password string }
type ErrorTransport ¶
type ErrorTransport struct {
Transport http.RoundTripper
}
type HttpStatusError ¶
type HttpStatusError struct { Response *http.Response Body []byte // Copied from `Response.Body` to avoid problems with unclosed bodies later. Nobody calls `err.Response.Body.Close()`, ever. }
func (*HttpStatusError) Error ¶
func (err *HttpStatusError) Error() string
type LogfCallback ¶
type LogfCallback func(format string, args ...interface{})
LogfCallback LogfCallback
type Registry ¶
type Registry struct { URL string Client *http.Client Logf LogfCallback }
Registry the client for image repostory
func New ¶
New new ssl registry client
- Create a new Registry with the given URL and credentials, then Ping()s it
- before returning it to verify that the registry is available. *
- You can, alternately, construct a Registry manually by populating the fields.
- This passes http.DefaultTransport to WrapTransport when creating the
- http.Client.
func NewInsecure ¶
NewInsecure new insecure skip verify tls client
- Create a new Registry, as with New, using an http.Transport that disables
- SSL certificate verification.
func (*Registry) CheckManifest ¶
CheckManifest checks if the manifest of the given image is exist.
func (*Registry) DeleteManifest ¶
DeleteManifest -
func (*Registry) Manifest ¶
func (registry *Registry) Manifest(repository, reference string) (*manifestV1.SignedManifest, error)
Manifest -
func (*Registry) ManifestDigest ¶
ManifestDigest -
func (*Registry) ManifestV2 ¶
func (registry *Registry) ManifestV2(repository, reference string) (*manifestV2.DeserializedManifest, error)
ManifestV2 -
func (*Registry) PutManifest ¶
func (registry *Registry) PutManifest(repository, reference string, signedManifest *manifestV1.SignedManifest) error
PutManifest -
func (*Registry) Repositories ¶
type TokenTransport ¶
type TokenTransport struct { Transport http.RoundTripper Username string Password string }