command

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2018 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

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 BaseUi struct {
	Writer      io.Writer
	ErrorWriter io.Writer
	// contains filtered or unexported fields
}

func (*BaseUi) Error

func (u *BaseUi) Error(v ...interface{})

func (*BaseUi) Errorf

func (u *BaseUi) Errorf(format string, v ...interface{})

func (*BaseUi) Fatal

func (u *BaseUi) Fatal(v ...interface{})

func (*BaseUi) Fatalf

func (u *BaseUi) Fatalf(format string, v ...interface{})

func (*BaseUi) Info

func (u *BaseUi) Info(v ...interface{})

func (*BaseUi) Infof

func (u *BaseUi) Infof(format string, v ...interface{})

func (*BaseUi) Output

func (u *BaseUi) Output(v ...interface{})

func (*BaseUi) Outputf

func (u *BaseUi) Outputf(format string, v ...interface{})

func (*BaseUi) Warn

func (u *BaseUi) Warn(v ...interface{})

func (*BaseUi) Warnf

func (u *BaseUi) Warnf(format string, v ...interface{})

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL