Documentation
¶
Index ¶
- func AtExit(f func())
- func Exit(code int)
- func InitConfig(configFile string, config *client.Configuration, verbose bool, ...)
- func PrintErr(err error)
- func SaveConfiguration(c interface{}) (err error)
- type Logger
- func (l Logger) Fatal(args ...interface{})
- func (l Logger) Fatalf(format string, args ...interface{})
- func (l Logger) Fatalln(args ...interface{})
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Panicln(v ...interface{})
- func (l Logger) Print(args ...interface{})
- func (l Logger) Printf(format string, args ...interface{})
- func (l Logger) Println(args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exit ¶
func Exit(code int)
Exit ensures that any registered functions are executed before exiting with the specified status code.
func InitConfig ¶ added in v0.5.0
func InitConfig(configFile string, config *client.Configuration, verbose bool, serverAddr string)
InitConfig reads in a config file and ENV variables if set. Configuration variable lookup occurs in a specific order.
func SaveConfiguration ¶
func SaveConfiguration(c interface{}) (err error)
SaveConfiguration saves the configuration to ~/.config/amp/amp.yaml
Types ¶
type Logger ¶ added in v0.5.0
type Logger struct {
Verbose bool
}
Logger is a simple logger for the cli that also implements grpclog.Logger
func (Logger) Fatal ¶ added in v0.5.0
func (l Logger) Fatal(args ...interface{})
Fatal is equivalent to l.Print() followed by a call to os.Exit(1).
func (Logger) Fatalf ¶ added in v0.5.0
Fatalf is equivalent to l.Printf() followed by a call to os.Exit(1).
func (Logger) Fatalln ¶ added in v0.5.0
func (l Logger) Fatalln(args ...interface{})
Fatalln is equivalent to l.Println() followed by a call to os.Exit(1).
func (*Logger) Panic ¶ added in v0.5.0
func (l *Logger) Panic(v ...interface{})
Panic is equivalent to l.Print() followed by a call to panic().
func (*Logger) Panicf ¶ added in v0.5.0
Panicf is equivalent to l.Printf() followed by a call to panic().
func (*Logger) Panicln ¶ added in v0.5.0
func (l *Logger) Panicln(v ...interface{})
Panicln is equivalent to l.Println() followed by a call to panic().
func (Logger) Print ¶ added in v0.5.0
func (l Logger) Print(args ...interface{})
Print delegates to log.Print Arguments are handled in the manner of fmt.Printf.