registryclient

package
v3.9.0-alpha.4+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: Apache-2.0 Imports: 17 Imported by: 205

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoCredentials auth.CredentialStore = &noopCredentialStore{}
)

Functions

func NewRetryRepository

func NewRetryRepository(repo distribution.Repository, retries int, interval time.Duration) distribution.Repository

NewRetryRepository wraps a distribution.Repository with helpers that will retry authentication failures over a limited time window and duration. This primarily avoids a DockerHub issue where public images unexpectedly return a 401 error due to the JWT token created by the hub being created at the same second, but another server being in the previous second.

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
	// contains filtered or unexported fields
}

func NewContext

func NewContext(transport, insecureTransport http.RoundTripper) *Context

NewContext is capable of creating RepositoryRetrievers.

func (*Context) Repository

func (c *Context) Repository(ctx gocontext.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error)

func (*Context) WithActions

func (c *Context) WithActions(actions ...string) *Context

func (*Context) WithCredentials

func (c *Context) WithCredentials(credentials auth.CredentialStore) *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 gocontext.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error)
}

RepositoryRetriever fetches a Docker distribution.Repository.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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