Documentation
¶
Overview ¶
Copyright 2015 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2015 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func SetParam(p Param, s kingpin.Settings)
- type BoolParam
- func (p *BoolParam) Args() []string
- func (p *BoolParam) CLIName() string
- func (p *BoolParam) Check() string
- func (p *BoolParam) Default() string
- func (p *BoolParam) Description() string
- func (p *BoolParam) EnvName() string
- func (p *BoolParam) EnvVars() (string, string)
- func (p *BoolParam) Name() string
- func (p *BoolParam) New() Param
- func (p *BoolParam) Required() bool
- func (p *BoolParam) Set(s string) error
- func (p *BoolParam) String() string
- func (p *BoolParam) Vars() (string, string)
- type Config
- type EnumParam
- func (p *EnumParam) Args() []string
- func (p *EnumParam) CLIName() string
- func (p *EnumParam) Check() string
- func (p *EnumParam) Default() string
- func (p *EnumParam) Description() string
- func (p *EnumParam) EnvName() string
- func (p *EnumParam) EnvVars() (string, string)
- func (p *EnumParam) Name() string
- func (p *EnumParam) New() Param
- func (p *EnumParam) Required() bool
- func (p *EnumParam) Set(s string) error
- func (p *EnumParam) String() string
- func (p *EnumParam) Vars() (string, string)
- type IntParam
- func (p *IntParam) Args() []string
- func (p *IntParam) CLIName() string
- func (p *IntParam) Check() string
- func (p *IntParam) Default() string
- func (p *IntParam) Description() string
- func (p *IntParam) EnvName() string
- func (p *IntParam) EnvVars() (string, string)
- func (p *IntParam) Name() string
- func (p *IntParam) New() Param
- func (p *IntParam) Required() bool
- func (p *IntParam) Set(s string) error
- func (p *IntParam) String() string
- func (p *IntParam) Vars() (string, string)
- type KVParam
- func (p *KVParam) Args() []string
- func (p *KVParam) CLIName() string
- func (p *KVParam) Check() string
- func (p *KVParam) Default() string
- func (p *KVParam) Description() string
- func (p *KVParam) EnvName() string
- func (p *KVParam) EnvVars() (string, string)
- func (p *KVParam) Name() string
- func (p *KVParam) New() Param
- func (p *KVParam) Required() bool
- func (p *KVParam) Set(s string) error
- func (p *KVParam) String() string
- func (p *KVParam) Vars() (string, string)
- type ListParam
- func (p *ListParam) Args() []string
- func (p *ListParam) CLIName() string
- func (p *ListParam) Check() string
- func (p *ListParam) Default() string
- func (p *ListParam) Description() string
- func (p *ListParam) EnvName() string
- func (p *ListParam) EnvVars() (string, string)
- func (p *ListParam) IsCumulative() bool
- func (p *ListParam) Name() string
- func (p *ListParam) New() Param
- func (p *ListParam) Required() bool
- func (p *ListParam) Set(s string) error
- func (p *ListParam) String() string
- func (p *ListParam) Vars() (string, string)
- type Param
- type PathParam
- func (p *PathParam) Args() []string
- func (p *PathParam) CLIName() string
- func (p *PathParam) Check() string
- func (p *PathParam) Default() string
- func (p *PathParam) Description() string
- func (p *PathParam) EnvName() string
- func (p *PathParam) EnvVars() (string, string)
- func (p *PathParam) Name() string
- func (p *PathParam) New() Param
- func (p *PathParam) Required() bool
- func (p *PathParam) Set(s string) error
- func (p *PathParam) String() string
- func (p *PathParam) Vars() (string, string)
- type StringParam
- func (p *StringParam) Args() []string
- func (p *StringParam) CLIName() string
- func (p *StringParam) Check() string
- func (p *StringParam) Default() string
- func (p *StringParam) Description() string
- func (p *StringParam) EnvName() string
- func (p *StringParam) EnvVars() (string, string)
- func (p *StringParam) Name() string
- func (p *StringParam) New() Param
- func (p *StringParam) Required() bool
- func (p *StringParam) Set(s string) error
- func (p *StringParam) String() string
- func (p *StringParam) Vars() (string, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolParam ¶
type BoolParam struct {
// contains filtered or unexported fields
}
func (*BoolParam) Description ¶
func (p *BoolParam) Description() string
type Config ¶
type Config struct {
Params []Param
}
type EnumParam ¶
type EnumParam struct {
// contains filtered or unexported fields
}
func (*EnumParam) Description ¶
func (p *EnumParam) Description() string
type IntParam ¶
type IntParam struct {
// contains filtered or unexported fields
}
func (*IntParam) Description ¶
func (p *IntParam) Description() string
type KVParam ¶
type KVParam struct {
// contains filtered or unexported fields
}
func (*KVParam) Description ¶
func (p *KVParam) Description() string
type ListParam ¶
type ListParam struct {
// contains filtered or unexported fields
}
ListParam defines a flag that accumulates multiple values
func (*ListParam) Description ¶
func (p *ListParam) Description() string
func (*ListParam) EnvName ¶
EnvName specifies the name of the environment variable that specifies the value for the parameter
func (*ListParam) IsCumulative ¶
IsCumulative determines whether the flag is cumulative - i.e. can be specified multiple times. Implements kingpin.repeatableFlag
type Param ¶
type Param interface { // Name is the parameter's name Name() string // CLIName specifies the name of the parameter as given on command line CLIName() string // Description specifies human-friendly parameter's description Description() string Check() string // Required is whether the parameter is required Required() bool // Default returns the default value for the parameter Default() string // New clones this parameter New() Param // Set is required to set parameters from command line string Set(string) error // String is required to output value to command line string String() string // Args returns argument strings in cli format Args() []string // EnvVars returns a tuple with environment variable name and value EnvVars() (string, string) // Vars returns a tuple with the variable name and value Vars() (string, string) // EnvName specifies the name of the environment variable that specifies // the value for the parameter EnvName() string }
Param is the command line parameter
type PathParam ¶
type PathParam struct {
// contains filtered or unexported fields
}
func (*PathParam) Description ¶
func (p *PathParam) Description() string
type StringParam ¶
type StringParam struct {
// contains filtered or unexported fields
}
func (*StringParam) Args ¶
func (p *StringParam) Args() []string
Args returns argument strings in cli format
func (*StringParam) Description ¶
func (p *StringParam) Description() string
func (*StringParam) EnvVars ¶
func (p *StringParam) EnvVars() (string, string)
EnvVars returns a tuple with environment variable name and value
func (*StringParam) Set ¶
func (p *StringParam) Set(s string) error
Set is required to set parameters from command line string
func (*StringParam) String ¶
func (p *StringParam) String() string
func (*StringParam) Vars ¶
func (p *StringParam) Vars() (string, string)
Vars returns a tuple with the variable name and value