Documentation ¶
Index ¶
- Constants
- Variables
- type BaseUi
- func (u *BaseUi) Error(v ...interface{})
- func (u *BaseUi) Errorf(format string, v ...interface{})
- func (u *BaseUi) Fatal(v ...interface{})
- func (u *BaseUi) Fatalf(format string, v ...interface{})
- func (u *BaseUi) Info(v ...interface{})
- func (u *BaseUi) Infof(format string, v ...interface{})
- func (u *BaseUi) Output(v ...interface{})
- func (u *BaseUi) Outputf(format string, v ...interface{})
- func (u *BaseUi) Warn(v ...interface{})
- func (u *BaseUi) Warnf(format string, v ...interface{})
- type LookupCommand
- type PrefixedUi
- func (u *PrefixedUi) Error(v ...interface{})
- func (u *PrefixedUi) Errorf(format string, v ...interface{})
- func (u *PrefixedUi) Fatal(v ...interface{})
- func (u *PrefixedUi) Fatalf(format string, v ...interface{})
- func (u *PrefixedUi) Info(v ...interface{})
- func (u *PrefixedUi) Infof(format string, v ...interface{})
- func (u *PrefixedUi) Output(v ...interface{})
- func (u *PrefixedUi) Outputf(format string, v ...interface{})
- func (u *PrefixedUi) PrependPrefix(prefix string, args []interface{}) []interface{}
- func (u *PrefixedUi) Warn(v ...interface{})
- func (u *PrefixedUi) Warnf(format string, v ...interface{})
- type ServerCommand
- type Ui
Constants ¶
View Source
const DefaultDatabasePath = "/var/lib/maxminddb/GeoLite2-City.mmdb"
Variables ¶
View Source
var OutputTypes = map[string]bool{ "json": true, "table": true, }
Functions ¶
This section is empty.
Types ¶
type BaseUi ¶
type LookupCommand ¶
type LookupCommand struct {
Ui Ui
}
func (*LookupCommand) Help ¶
func (c *LookupCommand) Help() string
func (*LookupCommand) Run ¶
func (c *LookupCommand) Run(args []string) int
func (*LookupCommand) Synopsis ¶
func (c *LookupCommand) Synopsis() string
type PrefixedUi ¶
type PrefixedUi struct {
Ui Ui
}
PrefixedUi is an implementation of Ui that prefixes messages.
func (*PrefixedUi) Error ¶
func (u *PrefixedUi) Error(v ...interface{})
func (*PrefixedUi) Errorf ¶
func (u *PrefixedUi) Errorf(format string, v ...interface{})
func (*PrefixedUi) Fatal ¶
func (u *PrefixedUi) Fatal(v ...interface{})
func (*PrefixedUi) Fatalf ¶
func (u *PrefixedUi) Fatalf(format string, v ...interface{})
func (*PrefixedUi) Info ¶
func (u *PrefixedUi) Info(v ...interface{})
func (*PrefixedUi) Infof ¶
func (u *PrefixedUi) Infof(format string, v ...interface{})
func (*PrefixedUi) Output ¶
func (u *PrefixedUi) Output(v ...interface{})
func (*PrefixedUi) Outputf ¶
func (u *PrefixedUi) Outputf(format string, v ...interface{})
func (*PrefixedUi) PrependPrefix ¶
func (u *PrefixedUi) PrependPrefix(prefix string, args []interface{}) []interface{}
func (*PrefixedUi) Warn ¶
func (u *PrefixedUi) Warn(v ...interface{})
func (*PrefixedUi) Warnf ¶
func (u *PrefixedUi) Warnf(format string, v ...interface{})
type ServerCommand ¶
type ServerCommand struct { Config *mm.Configuration Ui Ui // contains filtered or unexported fields }
func (*ServerCommand) Help ¶
func (c *ServerCommand) Help() string
func (*ServerCommand) IpLookupHandler ¶
func (c *ServerCommand) IpLookupHandler(writer http.ResponseWriter, req *http.Request, params httprouter.Params)
func (*ServerCommand) Run ¶
func (c *ServerCommand) Run(args []string) int
func (*ServerCommand) Synopsis ¶
func (c *ServerCommand) Synopsis() string
type Ui ¶
type Ui interface { // Output is called for normal standard output. Output(...interface{}) Outputf(string, ...interface{}) // Info is called for information related to the previous output. // In general this may be the exact same as Output, but this gives // Ui implementors some flexibility with output formats. Info(...interface{}) Infof(string, ...interface{}) // Error is used for any error messages that might appear on standard // error. Error(...interface{}) Errorf(string, ...interface{}) // Fatal are like Error, but exit immediately after rendering their message Fatal(...interface{}) Fatalf(string, ...interface{}) // Warn is used for any warning messages that might appear on standard // error. Warn(...interface{}) Warnf(string, ...interface{}) }
Ui is an interface for interacting with the terminal, or "interface" of a CLI. This abstraction doesn't have to be used, but helps provide a simple, layerable way to manage user interactions.
Click to show internal directories.
Click to hide internal directories.