registry

package
v0.0.0-...-7dd8fd7 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostURL = "https://index.docker.io"
)

Variables

View Source
var (
	ErrNoMorePages = errors.New("no more pages")
)

Functions

func ListRepoTags

func ListRepoTags(repository *RepositoryRequest) (semVerTags []*semver.Version, errTags []string, err error)

func Log

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

* Pass log messages along to Go's "log" module.

func Quiet

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

* Discard log messages silently.

func WrapTransport

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

* 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 AuthorizationChallenge

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

AuthorizationChallenge carries information from a WWW-Authenticate response header.

type BasicTransport

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

func (*BasicTransport) RoundTrip

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

type Environment

type Environment struct {
	StorePath  string
	DockerID   string
	DockerPass string
}

type ErrorTransport

type ErrorTransport struct {
	Transport http.RoundTripper
}

func (*ErrorTransport) RoundTrip

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

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
}

func (*HTTPStatusError) Error

func (err *HTTPStatusError) Error() string

type LogfCallback

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

type Registry

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

func New

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

* 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

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

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

func (*Registry) Ping

func (registry *Registry) Ping() error

func (*Registry) Tags

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

type RepositoryRequest

type RepositoryRequest struct {
	RepositoryUrl string
	User          string
	Password      string
	Repo          string
	Endpoint      string
	PageSize      uint8
	Major         int64
	Minor         int64
}

type SearchResults

type SearchResults struct {
	Results  dockerContainers `json:"results"`
	Query    string           `json:"query"`
	NumPages int              `json:"num_pages"`
}

func SearchContainer

func SearchContainer(containerName string, limit uint8) (error, SearchResults)

type TagResponse

type TagResponse struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

type TokenTransport

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

func (*TokenTransport) RoundTrip

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

Jump to

Keyboard shortcuts

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