Documentation ¶
Index ¶
- Variables
- type Client
- type LoginOption
- func WithLoginContext(context context.Context) LoginOption
- func WithLoginHostname(hostname string) LoginOption
- func WithLoginInsecure() LoginOption
- func WithLoginSecret(secret string) LoginOption
- func WithLoginUserAgent(userAgent string) LoginOption
- func WithLoginUsername(username string) LoginOption
- type LoginSettings
- type ResolverOption
- type ResolverSettings
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotLoggedIn = errors.New("not logged in")
)
Common errors
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Login logs in to a remote server identified by the hostname. // Deprecated: use LoginWithOpts Login(ctx context.Context, hostname, username, secret string, insecure bool) error // LoginWithOpts logs in to a remote server identified by the hostname with custom options LoginWithOpts(options ...LoginOption) error // Logout logs out from a remote server identified by the hostname. Logout(ctx context.Context, hostname string) error // Resolver returns a new authenticated resolver. // Deprecated: use ResolverWithOpts Resolver(ctx context.Context, client *http.Client, plainHTTP bool) (remotes.Resolver, error) // ResolverWithOpts returns a new authenticated resolver with custom options. ResolverWithOpts(options ...ResolverOption) (remotes.Resolver, error) }
Client provides authentication operations for remotes.
type LoginOption ¶
type LoginOption func(*LoginSettings)
LoginOption allows specifying various settings on login.
func WithLoginContext ¶
func WithLoginContext(context context.Context) LoginOption
WithLoginContext returns a function that sets the Context setting on login.
func WithLoginHostname ¶
func WithLoginHostname(hostname string) LoginOption
WithLoginHostname returns a function that sets the Hostname setting on login.
func WithLoginInsecure ¶
func WithLoginInsecure() LoginOption
WithLoginInsecure returns a function that sets the Insecure setting to true on login.
func WithLoginSecret ¶
func WithLoginSecret(secret string) LoginOption
WithLoginSecret returns a function that sets the Secret setting on login.
func WithLoginUserAgent ¶
func WithLoginUserAgent(userAgent string) LoginOption
WithLoginUserAgent returns a function that sets the UserAgent setting on login.
func WithLoginUsername ¶
func WithLoginUsername(username string) LoginOption
WithLoginUsername returns a function that sets the Username setting on login.
type LoginSettings ¶
type LoginSettings struct { Context context.Context Hostname string Username string Secret string Insecure bool UserAgent string }
LoginSettings represent all the various settings on login.
type ResolverOption ¶
type ResolverOption func(*ResolverSettings)
ResolverOption allows specifying various settings on the resolver.
func WithResolverClient ¶
func WithResolverClient(client *http.Client) ResolverOption
WithResolverClient returns a function that sets the Client setting on resolver.
func WithResolverHeaders ¶
func WithResolverHeaders(headers http.Header) ResolverOption
WithResolverHeaders returns a function that sets the Headers setting on resolver.
func WithResolverPlainHTTP ¶
func WithResolverPlainHTTP() ResolverOption
WithResolverPlainHTTP returns a function that sets the PlainHTTP setting to true on resolver.