Documentation
¶
Index ¶
- func WrapStatusError(err error) error
- type CLI
- type ExitError
- type Printer
- func NewJSONPrinter[T any, U []T | map[string]T](w io.Writer) Printer[T, U]
- func NewMapKeyPrinter[T any, U map[string]T](w io.Writer) Printer[T, U]
- func NewMapTablePrinter[T any, U map[string]T](w io.Writer, header []string, rowFunc func(T) []string, printKey bool) Printer[T, U]
- func NewSliceTablePrinter[T any, U []T](w io.Writer, header []string, rowFunc func(T) []string) Printer[T, U]
- type StatusError
- type Streams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapStatusError ¶
Types ¶
type CLI ¶
type CLI interface { Streams SetQuiet(bool) // Regular print to stdout. PrintOut(string, ...any) // Regular print to stderr. PrintErr(string, ...any) // Print to stderr unless quiet else - discard. PrintAux(string, ...any) SetConfig(*config.Config) Config() *config.Config SetClient(*api.Client) Client() *api.Client Confirm(title, affirmative, negative string) bool Input(title, prompt string, value *string, validate func(string) error) error Version() string }
type Printer ¶ added in v0.1.47
Printer prints a list of values.
func NewJSONPrinter ¶ added in v0.1.47
NewJSONPrinter outputs values as JSON.
func NewMapKeyPrinter ¶ added in v0.1.47
NewMapKeyPrinter outputs the keys of a map.
type StatusError ¶
type StatusError struct {
// contains filtered or unexported fields
}
func NewStatusError ¶
func NewStatusError(code int, format string, a ...any) StatusError
func (StatusError) Code ¶
func (e StatusError) Code() int
func (StatusError) Error ¶
func (e StatusError) Error() string
Click to show internal directories.
Click to hide internal directories.