mux

package
v0.2.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNoLoaderFound

func IsNoLoaderFound(err error) bool

IsNoLoaderFound indicates if the error is of type NoLoaderFoundError.

Types

type AuthLoader

type AuthLoader func(ctx context.Context, url string) (*types.AuthConfig, error)

AuthLoader is function that must be implemented by every cloud-specific registry authorization provider.

type NoLoaderFoundError

type NoLoaderFoundError struct {
	URL string
}

NoLoaderFoundError indicates the url multiplexer was unable to match the url to given auth loader.

func (NoLoaderFoundError) Error

func (e NoLoaderFoundError) Error() string

Error returns a descriptive error message.

type URLMux

type URLMux struct {
	// contains filtered or unexported fields
}

URLMux provides a means of multiplexing cloud registry authorization provides based on a URL.

func NewURLMux

func NewURLMux() *URLMux

NewURLMux returns an initialized form of the URLMux.

func (*URLMux) FromString

func (m *URLMux) FromString(url string) (AuthLoader, error)

FromString retrieves and authorization loader for a given url. An error is returned if no matching loader is found.

func (*URLMux) RegisterLoader

func (m *URLMux) RegisterLoader(re *regexp.Regexp, loader AuthLoader)

RegisterLoader will create a new url regex -> authorization loader scheme.

Jump to

Keyboard shortcuts

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