registry

package
v0.0.0-...-d1992f0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoMorePages var init
	ErrNoMorePages = errors.New("No more pages")
)

Functions

func Log

func Log(format string, args ...interface{})

Log func passes log messages along to Go's "log" module

func Quiet

func Quiet(format string, args ...interface{})

Quiet function discards log messages silently

func WrapTransport

func WrapTransport(transport http.RoundTripper, url, username, password string) http.RoundTripper

WrapTransport func init

  • Given 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 AuthService

type AuthService struct {
	Realm   string
	Service string
	Scope   string
}

AuthService struct init

func ParseOauthHeader

func ParseOauthHeader(resp *http.Response) *AuthService

ParseOauthHeader func init

func (*AuthService) Request

func (AuthService *AuthService) Request(username, password string) (*http.Request, error)

Request func init

type AuthorizationChallenge

type AuthorizationChallenge struct {
	Scheme     string
	Parameters map[string]string
}

AuthorizationChallenge carries information from a WWW-Authenticate response header.

func ParseAuthHeader

func ParseAuthHeader(header http.Header) []*AuthorizationChallenge

ParseAuthHeader func init

type BasicTransport

type BasicTransport struct {
	Transport http.RoundTripper
	URL       string
	Username  string
	Password  string
}

BasicTransport struct init

func (*BasicTransport) RoundTrip

func (t *BasicTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip func init

type ErrorTransport

type ErrorTransport struct {
	Transport http.RoundTripper
}

ErrorTransport struct init

func (*ErrorTransport) RoundTrip

func (t *ErrorTransport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip func init

type HTTPStatusError

type HTTPStatusError struct {
	Response *http.Response

	// Copied from `Response.Body` to avoid problems with unclosed bodies later.
	// Nobody calls `err.Response.Body.Close()`, ever.
	Body []byte
}

HTTPStatusError struct init

func (*HTTPStatusError) Error

func (err *HTTPStatusError) Error() string

type LogfCallback

type LogfCallback func(format string, args ...interface{})

LogfCallback func init

type Registry

type Registry struct {
	URL    string
	Client *http.Client
	Logf   LogfCallback
}

Registry struct init

func New

func New(registryURL, username, password string) (*Registry, error)

New Func init

  • Create a new Registry with the given URL and credentials, then Ping()s it
  • before returning it to verify that the Registry is available. *
  • Alternately, you can construct a Registry manually by populating the fields.
  • This passes http.DefaultTransport to WrapTransport when creating the
  • http.Client.

func NewInsecure

func NewInsecure(registryURL, username, password string) (*Registry, error)

NewInsecure func init

  • Create a new Registry, as with New, using an http.Transport that disables
  • SSL certificate verification.

func (*Registry) DeleteManifest

func (registry *Registry) DeleteManifest(repository string, digest digest.Digest) error

DeleteManifest func init

func (*Registry) Manifest

func (registry *Registry) Manifest(repository, reference string) (*manifestV1.SignedManifest, error)

Manifest func init

func (*Registry) ManifestDigest

func (registry *Registry) ManifestDigest(repository, reference string) (digest.Digest, error)

ManifestDigest func init

func (*Registry) ManifestDigestV2

func (registry *Registry) ManifestDigestV2(repository, reference string) (digest.Digest, error)

ManifestDigestV2 func init

func (*Registry) ManifestV2

func (registry *Registry) ManifestV2(repository, reference string) (*manifestV2.DeserializedManifest, error)

ManifestV2 func init

func (*Registry) Ping

func (r *Registry) Ping() error

Ping func init

func (*Registry) PutManifest

func (registry *Registry) PutManifest(repository, reference string, signedManifest *manifestV1.SignedManifest) error

PutManifest func init

func (*Registry) Repositories

func (registry *Registry) Repositories() ([]string, error)

Repositories func init

func (*Registry) Tags

func (registry *Registry) Tags(repository string) (tags []string, err error)

Tags func init

type TokenTransport

type TokenTransport struct {
	Transport http.RoundTripper
	Username  string
	Password  string
}

TokenTransport struct init

func (*TokenTransport) RoundTrip

func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip func init

Jump to

Keyboard shortcuts

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