Documentation ¶
Index ¶
- Constants
- Variables
- func InitCmd(c *Context) (*ngsilib.NGSI, error)
- func NewClient(ngsi *ngsilib.NGSI, c *Context, isHTTPVerb bool, serverList []string) (*ngsilib.Client, error)
- func NewClientSkipGetToken(ngsi *ngsilib.NGSI, c *Context, isHTTPVerb bool, serverList []string) (*ngsilib.Client, error)
- func ParseOptions(c *Context, args []string, opts []string) *url.Values
- type ActionFunc
- type App
- type Args
- type BoolFlag
- func (f *BoolFlag) AllowEmpty() bool
- func (f *BoolFlag) Check(name, alias string) bool
- func (f *BoolFlag) Copy(reset bool) Flag
- func (f *BoolFlag) FlagAliases() []string
- func (f *BoolFlag) FlagHidden() bool
- func (f *BoolFlag) FlagName() string
- func (f *BoolFlag) FlagNameList() string
- func (f *BoolFlag) FlagUsage() string
- func (f *BoolFlag) IsInitClient() bool
- func (f *BoolFlag) IsRequired() bool
- func (f *BoolFlag) IsSet() bool
- func (f *BoolFlag) SetValue(v interface{}) error
- type Command
- type Context
- func (c *Context) Args() Args
- func (c *Context) Bool(flag string) bool
- func (c *Context) FlagNames() []string
- func (c *Context) GetFlag(name string) Flag
- func (c *Context) GetStringFlag(name string) *StringFlag
- func (c *Context) HasFlag(name string) bool
- func (c *Context) Int64(flag string) int64
- func (c *Context) IsRequired(name string) bool
- func (c *Context) IsSet(flag string) bool
- func (c *Context) IsSetAND(params []string) bool
- func (c *Context) IsSetOR(params []string) bool
- func (c *Context) String(flag string) string
- type Flag
- type Int64Flag
- func (f *Int64Flag) AllowEmpty() bool
- func (f *Int64Flag) Check(name, alias string) bool
- func (f *Int64Flag) Copy(reset bool) Flag
- func (f *Int64Flag) FlagAliases() []string
- func (f *Int64Flag) FlagHidden() bool
- func (f *Int64Flag) FlagName() string
- func (f *Int64Flag) FlagNameList() string
- func (f *Int64Flag) FlagUsage() string
- func (f *Int64Flag) IsInitClient() bool
- func (f *Int64Flag) IsRequired() bool
- func (f *Int64Flag) IsSet() bool
- func (f *Int64Flag) SetValue(v interface{}) error
- type StringFlag
- func (f *StringFlag) AllowEmpty() bool
- func (f *StringFlag) Check(name, alias string) bool
- func (f *StringFlag) Copy(reset bool) Flag
- func (f *StringFlag) FlagAliases() []string
- func (f *StringFlag) FlagHidden() bool
- func (f *StringFlag) FlagName() string
- func (f *StringFlag) FlagNameList() string
- func (f *StringFlag) FlagUsage() string
- func (f *StringFlag) IsInitClient() bool
- func (f *StringFlag) IsRequired() bool
- func (f *StringFlag) IsSet() bool
- func (f *StringFlag) SetValue(v interface{}) error
- type ValidationFlag
Constants ¶
View Source
const ( NonCondition = iota NandCondition XnorCondition )
Variables ¶
View Source
var ( SyslogFlag = &StringFlag{ Name: "syslog", Usage: "syslog logging `LEVEL` (off, err, info, debug)", Choices: []string{"off", "err", "info", "debug"}, } StderrFlag = &StringFlag{ Name: "stderr", Usage: "stderr logging `LEVEL` (err, info, debug)", Choices: []string{"off", "err", "info", "debug"}, } ConfigDirFlag = &StringFlag{ Name: "configDir", Usage: "configuration `DIR` name", } ConfigFlag = &StringFlag{ Name: "config", Usage: "configuration `FILE` name", } CacheFlag = &StringFlag{ Name: "cache", Usage: "cache `FILE` name", } HelpFlag = &BoolFlag{ Name: "help", Usage: "show help", } MarginFlag = &Int64Flag{ Name: "margin", Usage: "I/O time out (second)", Hidden: true, Value: 180, } TimeOutFlag = &Int64Flag{ Name: "timeout", Usage: "I/O time out (second)", Hidden: true, Value: 60, } MaxCountFlag = &Int64Flag{ Name: "maxCount", Usage: "maxCount", Hidden: true, Value: 100, } BatchFlag = &BoolFlag{ Name: "batch", Aliases: []string{"B"}, Usage: "don't use previous args (batch)", } CmdNameFlag = &StringFlag{ Name: "cmdName", Hidden: true, } InsecureSkipVerifyFlag = &BoolFlag{ Name: "insecureSkipVerify", Usage: "TLS/SSL skip certificate verification", } )
Global Flags
View Source
var ( HostRFlag = &StringFlag{ Name: "host", Usage: "broker or server host `VALUE`", Aliases: []string{"h"}, Required: true, InitClient: true, PreviousArgs: true, } HostFlag = &StringFlag{ Name: "host", Usage: "broker or server host `VALUE`", Aliases: []string{"h"}, } TenantFlag = &StringFlag{ Name: "service", Aliases: []string{"s"}, Usage: "FIWARE Service `VALUE`", ValueEmpty: true, } ScopeFlag = &StringFlag{ Name: "path", Aliases: []string{"p"}, Usage: "FIWARE ServicePath `VALUE`", ValueEmpty: true, } OAuthTokenFlag = &StringFlag{ Name: "oAuthToken", Usage: "OAuth token `VALUE`", Hidden: true, ValueEmpty: true, } XAuthTokenFlag = &BoolFlag{ Name: "xAuthToken", Usage: "use X-Auth-Token", Hidden: true, } )
View Source
var ( SafeStringFlag = &StringFlag{ Name: "safeString", Usage: "use safe string (`VALUE`: on/off)", } NgsiTypeFlag = &StringFlag{ Name: "ngsiType", Usage: "NGSI type: v2 or ld", } )
View Source
var ( VerboseFlag = &BoolFlag{ Name: "verbose", Aliases: []string{"v"}, Usage: "verbose", } JsonFlag = &BoolFlag{ Name: "json", Aliases: []string{"j"}, Usage: "JSON format", } PrettyFlag = &BoolFlag{ Name: "pretty", Aliases: []string{"P"}, Value: false, Usage: "pretty format", } RunFlag = &BoolFlag{ Name: "run", Usage: "run command", Value: false, } )
View Source
var ( Version string Revision string )
View Source
var CmdMode = ""
View Source
var Copyright string
View Source
var GlobalFlags = []Flag{ SyslogFlag, StderrFlag, ConfigDirFlag, ConfigFlag, CacheFlag, MarginFlag, TimeOutFlag, MaxCountFlag, BatchFlag, InsecureSkipVerifyFlag, CmdNameFlag, }
Functions ¶
func NewClientSkipGetToken ¶
Types ¶
type App ¶
type BoolFlag ¶
type BoolFlag struct { Name string Aliases []string Usage string Value bool Hidden bool Set bool Required bool }
func (*BoolFlag) AllowEmpty ¶
func (*BoolFlag) FlagAliases ¶
func (*BoolFlag) FlagHidden ¶
func (*BoolFlag) FlagNameList ¶
func (*BoolFlag) IsInitClient ¶
func (*BoolFlag) IsRequired ¶
type Context ¶
type Context struct { App *App Ngsi *ngsilib.NGSI Client *ngsilib.Client Client2 *ngsilib.Client Flags []Flag GlobalFlags []Flag RequiredFlags []string Arg *cmdArgs Commands []*Command ServerList []string CommandName string HelpCommand bool Bashcompletion bool }
func NewContext ¶
func (*Context) GetStringFlag ¶
func (c *Context) GetStringFlag(name string) *StringFlag
func (*Context) IsRequired ¶
type Int64Flag ¶
type Int64Flag struct { Name string Aliases []string Usage string Value int64 Hidden bool Set bool Required bool }
func (*Int64Flag) AllowEmpty ¶
func (*Int64Flag) FlagAliases ¶
func (*Int64Flag) FlagHidden ¶
func (*Int64Flag) FlagNameList ¶
func (*Int64Flag) IsInitClient ¶
func (*Int64Flag) IsRequired ¶
type StringFlag ¶
type StringFlag struct { Name string Aliases []string Usage string Value string Hidden bool Set bool Required bool InitClient bool SkipGetToken bool ValueEmpty bool PreviousArgs bool SkipRefHost bool Choices []string }
func (*StringFlag) AllowEmpty ¶
func (f *StringFlag) AllowEmpty() bool
func (*StringFlag) Check ¶
func (f *StringFlag) Check(name, alias string) bool
func (*StringFlag) Copy ¶
func (f *StringFlag) Copy(reset bool) Flag
func (*StringFlag) FlagAliases ¶
func (f *StringFlag) FlagAliases() []string
func (*StringFlag) FlagHidden ¶
func (f *StringFlag) FlagHidden() bool
func (*StringFlag) FlagName ¶
func (f *StringFlag) FlagName() string
func (*StringFlag) FlagNameList ¶
func (f *StringFlag) FlagNameList() string
func (*StringFlag) FlagUsage ¶
func (f *StringFlag) FlagUsage() string
func (*StringFlag) IsInitClient ¶
func (f *StringFlag) IsInitClient() bool
func (*StringFlag) IsRequired ¶
func (f *StringFlag) IsRequired() bool
func (*StringFlag) IsSet ¶
func (f *StringFlag) IsSet() bool
func (*StringFlag) SetValue ¶
func (f *StringFlag) SetValue(v interface{}) error
type ValidationFlag ¶
Click to show internal directories.
Click to hide internal directories.