oras

package
v0.0.0-...-f1e9103 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Credential

func Credential(username, password string) auth.Credential

Credential returns an auth.Credential that Store can use.

func NewClient

func NewClient(opts ClientOptions) remote.Client

NewClient generates a client based on the passed in options.

Types

type ClientOptions

type ClientOptions struct {
	Credential      auth.Credential
	CredentialStore *Store
	Debug           bool
}

ClientOptions type includes a Credential that stores the credentials of the client. CredentialStore will be used if a Credential is not provided. ClientOptions also includes a Debug flag.

type DebugTransport

type DebugTransport struct {
	http.RoundTripper
}

DebugTransport is an http.RoundTripper that keeps track of the in-flight request and add hooks to report HTTP tracing events.

func NewDebugTransport

func NewDebugTransport(base http.RoundTripper) *DebugTransport

NewDebugTransport generates a new DebugTransport.

func (*DebugTransport) RoundTrip

func (t *DebugTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip calls base roundtrip while keeping track of the current request.

type Store

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

Store provides credential CRUD operations.

func NewStore

func NewStore(configPaths ...string) (*Store, error)

NewStore generates a store based on the passed in config file path.

func (*Store) Credential

func (s *Store) Credential(_ context.Context, registry string) (auth.Credential, error)

Credential iterates all the config files, returns the first non-empty credential in a best-effort way. `EmptyCredential` is a valid return value and should not be considered as an error. If nil, the credential is always resolved to `EmptyCredential`.

func (*Store) Erase

func (s *Store) Erase(registry string) error

Erase erases a credential for a given registry.

func (*Store) Store

func (s *Store) Store(registry string, cred auth.Credential) error

Store stores a credential for a given registry.

Jump to

Keyboard shortcuts

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