Documentation ¶
Index ¶
- Variables
- func ContentDigestForManifest(manifest distribution.Manifest, algo digest.Algorithm) (digest.Digest, error)
- func NewLimitedRetryRepository(repo distribution.Repository, retries int, limiter *rate.Limiter) distribution.Repository
- func VerifyManifestIntegrity(manifest distribution.Manifest, dgst digest.Digest) error
- type AuthHandlersFunc
- type BasicCredentials
- type Context
- func (c *Context) Copy() *Context
- func (c *Context) Ping(ctx context.Context, registry *url.URL, insecure bool) (http.RoundTripper, *url.URL, error)
- func (c *Context) Repository(ctx context.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error)
- func (c *Context) Reset()
- func (c *Context) WithActions(actions ...string) *Context
- func (c *Context) WithCredentials(credentials auth.CredentialStore) *Context
- func (c *Context) WithRateLimiter(limiter *rate.Limiter) *Context
- func (c *Context) WithScopes(scopes ...auth.Scope) *Context
- type ErrNotV2Registry
- type RefreshTokenStore
- type RepositoryRetriever
Constants ¶
This section is empty.
Variables ¶
var (
NoCredentials auth.CredentialStore = &noopCredentialStore{}
)
Functions ¶
func ContentDigestForManifest ¶
func ContentDigestForManifest(manifest distribution.Manifest, algo digest.Algorithm) (digest.Digest, error)
ContentDigestForManifest returns the digest in the provided algorithm of the supplied manifest's contents.
func NewLimitedRetryRepository ¶
func NewLimitedRetryRepository(repo distribution.Repository, retries int, limiter *rate.Limiter) distribution.Repository
NewLimitedRetryRepository wraps a distribution.Repository with helpers that will retry temporary failures over a limited time window and duration, and also obeys a rate limit.
func VerifyManifestIntegrity ¶
func VerifyManifestIntegrity(manifest distribution.Manifest, dgst digest.Digest) error
VerifyManifestIntegrity checks the provided manifest against the specified digest and returns an error if the manifest does not match that digest.
Types ¶
type AuthHandlersFunc ¶
type AuthHandlersFunc func(transport http.RoundTripper, registry *url.URL, repoName string) []auth.AuthenticationHandler
type BasicCredentials ¶
type BasicCredentials struct {
// contains filtered or unexported fields
}
func NewBasicCredentials ¶
func NewBasicCredentials() *BasicCredentials
func (*BasicCredentials) Add ¶
func (c *BasicCredentials) Add(url *url.URL, username, password string)
func (BasicCredentials) RefreshToken ¶
type Context ¶
type Context struct { Transport http.RoundTripper InsecureTransport http.RoundTripper Challenges challenge.Manager Scopes []auth.Scope Actions []string Retries int Credentials auth.CredentialStore Limiter *rate.Limiter DisableDigestVerification bool // contains filtered or unexported fields }
func NewContext ¶
func NewContext(transport, insecureTransport http.RoundTripper) *Context
NewContext is capable of creating RepositoryRetrievers.
func (*Context) Ping ¶
func (c *Context) Ping(ctx context.Context, registry *url.URL, insecure bool) (http.RoundTripper, *url.URL, error)
Ping contacts a registry and returns the transport and URL of the registry or an error.
func (*Context) Repository ¶
func (c *Context) Repository(ctx context.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error)
func (*Context) Reset ¶
func (c *Context) Reset()
Reset clears any cached repository info for this context.
func (*Context) WithActions ¶
func (*Context) WithCredentials ¶
func (c *Context) WithCredentials(credentials auth.CredentialStore) *Context
type ErrNotV2Registry ¶
type ErrNotV2Registry struct {
Registry string
}
ErrNotV2Registry is returned when the server does not report itself as a V2 Docker registry
func (*ErrNotV2Registry) Error ¶
func (e *ErrNotV2Registry) Error() string
type RefreshTokenStore ¶
type RefreshTokenStore interface { RefreshToken(url *url.URL, service string) string SetRefreshToken(url *url.URL, service string, token string) }
func NewRefreshTokenStore ¶
func NewRefreshTokenStore() RefreshTokenStore
type RepositoryRetriever ¶
type RepositoryRetriever interface { // Repository returns a properly authenticated distribution.Repository for the given registry, repository // name, and insecure toleration behavior. Repository(ctx context.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error) }
RepositoryRetriever fetches a Docker distribution.Repository.