registryclient

package
v0.0.0-...-db72f7f Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Basic

func (c *BasicCredentials) Basic(url *url.URL) (string, string)

func (BasicCredentials) RefreshToken

func (s BasicCredentials) RefreshToken(url *url.URL, service string) string

func (BasicCredentials) SetRefreshToken

func (s BasicCredentials) SetRefreshToken(url *url.URL, service string, token string)

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) Copy

func (c *Context) Copy() *Context

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 (c *Context) WithActions(actions ...string) *Context

func (*Context) WithCredentials

func (c *Context) WithCredentials(credentials auth.CredentialStore) *Context

func (*Context) WithRateLimiter

func (c *Context) WithRateLimiter(limiter *rate.Limiter) *Context

func (*Context) WithScopes

func (c *Context) WithScopes(scopes ...auth.Scope) *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.

Jump to

Keyboard shortcuts

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