Documentation
¶
Index ¶
- func NewAuthenticatedTransport(ctx context.Context, f *authcli.Flags) (http.RoundTripper, error)
- func NewAuthenticator(ctx context.Context, f *authcli.Flags) (*auth.Authenticator, error)
- func NewHTTPClient(ctx context.Context, f *authcli.Flags) (*http.Client, error)
- func NewQuietUsageError(flags flag.FlagSet, format string, a ...interface{}) error
- func NewUsageError(flags flag.FlagSet, format string, a ...interface{}) error
- func PrintError(a subcommands.Application, err error)
- type UserErrorReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthenticatedTransport ¶
NewAuthenticatedTransport creates a new authenticated transport
func NewAuthenticator ¶
NewAuthenticator creates a new authenticator based on flags.
func NewHTTPClient ¶
NewHTTPClient returns an HTTP client with authentication set up.
func NewQuietUsageError ¶
NewQuietUsageError creates a new error that only reports flags usage error details
func NewUsageError ¶
NewUsageError creates a new error that also reports flags usage error details.
func PrintError ¶
func PrintError(a subcommands.Application, err error)
PrintError reports errors back to the user.
Detailed error information is printed if err is a UserErrorReporter.
Types ¶
type UserErrorReporter ¶
type UserErrorReporter interface { // Report a user-friendly error through w. ReportUserError(w io.Writer) }
UserErrorReporter reports a detailed error message to the user.
PrintError() uses a UserErrorReporter to print multi-line user error details along with the actual error.
Click to show internal directories.
Click to hide internal directories.