Versions in this module Expand all Collapse all v0 v0.9.1 Jul 2, 2018 Changes in this version + const DocAdditionalHelpTopics + const DocAliases + const DocAvailableCommands + const DocBaseDelimiter + const DocCfgForce + const DocCfgLocation + const DocCmdFlags + const DocCmdlineDelimiter + const DocConfFile + const DocConfigCmd + const DocConfigDelimiter + const DocConfigDisplayCmd + const DocConfigEnvCmd + const DocConfigEnvMsg1 + const DocConfigEnvMsg2 + const DocConfigEnvMsg3 + const DocConfigHeader + const DocConfigInitCmd + const DocCustomDelimiter + const DocDoTrace + const DocExample + const DocExamples + const DocFlags + const DocGlobalFlags + const DocHelpCmd + const DocHelpDelimiter + const DocHelpFlag + const DocLogFile + const DocLogLevel + const DocLong + const DocNoCfg + const DocNoEnv + const DocPretty + const DocProvidesMoreInformationAboutACommand + const DocShort + const DocUsage + const DocUsageDelimiter + const DocUse + const DocVerbosity + const DocVersionCmd + func ConvertOrPanic(unprocessedDocs map[string][]string) map[string]*DocSet + type BaseConfig struct + CfgForce bool + CfgLocation *EnumValue + ConfFile string + DoTrace bool + LogFile string + LogLevel *EnumValue + NoCfg bool + NoEnv bool + Pretty bool + Verbosity *IntValue + VersionFull string + VersionMajor string + VersionMinor string + VersionPatchlevel string + func NewBaseConfig(appname string, fmap map[string]Handler) *BaseConfig + func (cfg *BaseConfig) Cleanup() + func (cfg *BaseConfig) Debug(s string) + func (cfg *BaseConfig) Debugf(format string, vals ...interface{}) + func (cfg *BaseConfig) Debugq(s string) + func (cfg *BaseConfig) Debugqf(format string, vals ...interface{}) + func (cfg *BaseConfig) Debugqs(s string, vals ...LogField) + func (cfg *BaseConfig) Debugs(s string, vals ...LogField) + func (cfg *BaseConfig) Debugv(s string) + func (cfg *BaseConfig) Debugvf(format string, vals ...interface{}) + func (cfg *BaseConfig) Debugvs(s string, vals ...LogField) + func (cfg *BaseConfig) Dump(icfg Config) (string, error) + func (cfg *BaseConfig) Error(s string) + func (cfg *BaseConfig) Errorf(format string, vals ...interface{}) + func (cfg *BaseConfig) Errors(s string, vals ...LogField) + func (cfg *BaseConfig) Execute(icfg Config, userDocList map[string]*DocSet) error + func (cfg *BaseConfig) GetConfigFile() string + func (cfg *BaseConfig) GetCurrentCommand() string + func (cfg *BaseConfig) GetDefaultLanguage() string + func (cfg *BaseConfig) GetDocs() (string, *DocSet) + func (cfg *BaseConfig) GetFs() afero.Fs + func (cfg *BaseConfig) GetLogger() Logger + func (cfg *BaseConfig) Info(s string) + func (cfg *BaseConfig) Infof(format string, vals ...interface{}) + func (cfg *BaseConfig) Infoq(s string) + func (cfg *BaseConfig) Infoqf(format string, vals ...interface{}) + func (cfg *BaseConfig) Infoqs(s string, vals ...LogField) + func (cfg *BaseConfig) Infos(s string, vals ...LogField) + func (cfg *BaseConfig) Infov(s string) + func (cfg *BaseConfig) Infovf(format string, vals ...interface{}) + func (cfg *BaseConfig) Infovs(s string, vals ...LogField) + func (cfg *BaseConfig) LogDuration(s string, value time.Duration) LogField + func (cfg *BaseConfig) LogGeneric(s string, value interface{}) LogField + func (cfg *BaseConfig) LogInteger(s string, value int) LogField + func (cfg *BaseConfig) LogString(s string, value string) LogField + func (cfg *BaseConfig) LogTime(s string, value time.Time) LogField + func (cfg *BaseConfig) RegisterExtraParse(f func(Config, map[string]interface{}) ([]string, error), a []string) + func (cfg *BaseConfig) SetFs(fs afero.Fs) + func (cfg *BaseConfig) SetHandler(handler OverrideHandler, h Handler) error + func (cfg *BaseConfig) SetLoggers(structured, pretty MakeLogger, trace MakeTraceLogger) error + func (cfg *BaseConfig) SetOptions(opts BaseConfigOptions) error + func (cfg *BaseConfig) StartTracing() + func (cfg *BaseConfig) StopTracing() + func (cfg *BaseConfig) TestHelper(task string, value interface{}) interface{} + func (cfg *BaseConfig) Trace(s string) + func (cfg *BaseConfig) TraceSkipf(skip int, format string, vals ...interface{}) + func (cfg *BaseConfig) Tracef(format string, vals ...interface{}) + func (cfg *BaseConfig) Unmarshal(s string, v interface{}) error + func (cfg *BaseConfig) Warn(s string) + func (cfg *BaseConfig) Warnf(format string, vals ...interface{}) + func (cfg *BaseConfig) Warns(s string, vals ...LogField) + type BaseConfigOptions struct + DefaultLanguage string + VersionFull string + VersionMajor string + VersionMinor string + VersionPatchlevel string + type CmdHelp struct + Example string + Long string + Short string + Use string + type Config interface + Cleanup func() + Debug func(string) + Debugf func(string, ...interface{}) + Debugq func(string) + Debugqf func(string, ...interface{}) + Debugqs func(string, ...LogField) + Debugs func(string, ...LogField) + Debugv func(string) + Debugvf func(string, ...interface{}) + Debugvs func(string, ...LogField) + Dump func(Config) (string, error) + Error func(string) + Errorf func(string, ...interface{}) + Errors func(string, ...LogField) + Execute func(Config, map[string]*DocSet) error + GetConfigFile func() string + GetCurrentCommand func() string + GetDefaultLanguage func() string + GetDocs func() (string, *DocSet) + GetFs func() afero.Fs + GetLogger func() Logger + Info func(string) + Infof func(string, ...interface{}) + Infoq func(string) + Infoqf func(string, ...interface{}) + Infoqs func(string, ...LogField) + Infos func(string, ...LogField) + Infov func(string) + Infovf func(string, ...interface{}) + Infovs func(string, ...LogField) + LogDuration func(string, time.Duration) LogField + LogGeneric func(string, interface{}) LogField + LogInteger func(string, int) LogField + LogString func(string, string) LogField + LogTime func(string, time.Time) LogField + RegisterExtraParse func(func(Config, map[string]interface{}) ([]string, error), []string) + SetFs func(afero.Fs) + SetHandler func(OverrideHandler, Handler) error + SetLoggers func(MakeLogger, MakeLogger, MakeTraceLogger) error + SetOptions func(BaseConfigOptions) error + StartTracing func() + StopTracing func() + TestHelper func(string, interface{}) interface{} + Trace func(string) + Tracef func(string, ...interface{}) + Unmarshal func(string, interface{}) error + Warn func(string) + Warnf func(string, ...interface{}) + Warns func(string, ...LogField) + type CustomStringHandler func(string, string, interface{}) (string, error) + type CustomStringValue struct + Value string + func NewCustomStringValue(name string, validate CustomStringHandler, data interface{}) *CustomStringValue + func NewDefaultCustomStringValue(name string, set string, validate CustomStringHandler, data interface{}) *CustomStringValue + func (c *CustomStringValue) GetTyped() string + func (c *CustomStringValue) MarshalText() (text []byte, err error) + func (c *CustomStringValue) Set(s string) (err error) + func (c *CustomStringValue) String() string + func (c *CustomStringValue) Type() string + func (c *CustomStringValue) UnmarshalText(text []byte) error + type DocSet struct + CmdFlags string + CmdLine map[string]string + ConfigEnvMsg1 string + ConfigEnvMsg2 string + ConfigEnvMsg3 string + ConfigFile map[string]string + Custom map[string]string + Example string + Help *HelpStrings + HelpFlag string + Long string + Short string + Usage map[string]*CmdHelp + Use string + func ConvertDocs(udoc []string) (*DocSet, error) + type EnumValue struct + func NewDefaultEnumValue(name, set string, valid ...string) *EnumValue + func NewEnumValue(name string, valid ...string) *EnumValue + type Handler func(Config, []string) error + type HelpStrings struct + AdditionalHelpTopics string + Aliases string + AvailableCommands string + Examples string + Flags string + GlobalFlags string + ProvidesMoreInformationAboutACommand string + Usage string + type IPValue struct + func NewDefaultIPValue(name, set string) *IPValue + func NewIPValue(name string) *IPValue + type IntValue struct + Value int + func NewDefaultIntValue(name string, set, min, max int) *IntValue + func NewIntValue(name string, min, max int) *IntValue + func (i *IntValue) GetTyped() int + func (i *IntValue) MarshalText() (text []byte, err error) + func (i *IntValue) Set(s string) (err error) + func (i *IntValue) SetInt(d int) (err error) + func (i *IntValue) String() string + func (i *IntValue) Type() string + func (i *IntValue) UnmarshalText(text []byte) error + type LogField struct + Duration time.Duration + Generic interface{} + Integer int + Key string + String string + Time time.Time + Type uint8 + type Logger interface + Custom func(string, int, interface{}) + DebugSkip func(int, string) + DebugStructured func(string, ...LogField) + ErrorStructured func(string, ...LogField) + InfoStructured func(string, ...LogField) + LogDuration func(string, time.Duration) LogField + LogGeneric func(string, interface{}) LogField + LogInteger func(string, int) LogField + LogString func(string, string) LogField + LogTime func(string, time.Time) LogField + Sync func() error + WarnStructured func(string, ...LogField) + func BasePrettyLogger(cfg Config, l string, w io.Writer) Logger + func BaseStructuredLogger(cfg Config, l string, w io.Writer) Logger + func BaseTraceLogger(cfg Config) Logger + type MakeLogger func(Config, string, io.Writer) Logger + type MakeTraceLogger func(Config) Logger + type OverrideHandler int + const OverrideConfigHandler + const OverridePreExecHandler + const OverrideRootHandler + const OverrideVersionHandler + type PortValue uint16 + func NewPortValue() PortValue + func (p *PortValue) GetTyped() uint16 + func (p *PortValue) MarshalText() (text []byte, err error) + func (p *PortValue) Set(e string) (err error) + func (p *PortValue) SetInt(i int) (err error) + func (p *PortValue) String() string + func (p *PortValue) Type() string + func (p *PortValue) UnmarshalText(text []byte) error