Documentation
¶
Index ¶
- Constants
- Variables
- func CheckDisallowed(prefix string, spec interface{}) error
- func LoadDefaultFromYml(filePath string) error
- func MustProcess(prefix string, spec interface{})
- func Process(prefix string, spec interface{}) error
- func StringifyPath(paths ...interface{}) string
- func UnmarshalExtra(extra url.Values, v interface{}) error
- func Usage(prefix string, spec interface{}, security bool) error
- func Usagef(prefix string, spec interface{}, out io.Writer, format string, security bool) error
- func Usaget(prefix string, spec interface{}, out io.Writer, tmpl *template.Template) error
- type Decoder
- type Duration
- type Endpoint
- type Endpoints
- type EnvVar
- type ISecurityStringer
- type ParseError
- type Password
- type PathWalker
- type Setter
Constants ¶
const ( // DefaultListFormat constant to use to display usage in a list format DefaultListFormat = `` /* 316-byte string literal not displayed */ // DefaultTableFormat constant to use to display usage in a tabular format DefaultTableFormat = `` /* 281-byte string literal not displayed */ )
const DefaultEndpointSeparator = "<|>"
Variables ¶
var ErrInvalidSpecification = errors.New("specification must be a struct pointer")
ErrInvalidSpecification indicates that a specification is of the wrong type.
Functions ¶
func CheckDisallowed ¶ added in v1.10.7
CheckDisallowed checks that no environment variables with the prefix are set that we don't know how or want to parse. This is likely only meaningful with a non-empty prefix.
func LoadDefaultFromYml ¶ added in v1.10.7
func MustProcess ¶ added in v1.10.7
func MustProcess(prefix string, spec interface{})
MustProcess is the same as Process but panics if an error occurs
func Process ¶ added in v1.10.7
Process populates the specified struct based on environment variables
func StringifyPath ¶
func StringifyPath(paths ...interface{}) string
func UnmarshalExtra ¶
func Usage ¶ added in v1.10.7
Usage writes usage information to stdout using the default header and table format
Types ¶
type Decoder ¶ added in v1.10.7
Decoder has the same semantics as Setter, but takes higher precedence. It is provided for historical compatibility.
type Endpoint ¶
type Endpoint struct {
Scheme string
Hostname string
Port uint16
Base string
Path string
Username string
Password string
Extra url.Values
}
openapi:strfmt endpoint
func ParseEndpoint ¶
func (Endpoint) MarshalText ¶
func (Endpoint) SecurityString ¶
func (*Endpoint) UnmarshalText ¶
type Endpoints ¶ added in v1.10.7
type Endpoints []Endpoint
openapi:strfmt endpoint
func (Endpoints) MarshalText ¶ added in v1.10.7
func (Endpoints) SecurityString ¶ added in v1.10.7
func (*Endpoints) UnmarshalText ¶ added in v1.10.7
type EnvVar ¶
type EnvVar struct {
Name string
Alt string
Key string
Field reflect.Value
Tags reflect.StructTag
Optional bool
IsUpstream bool
IsCopy bool
IsExpose bool
IsHealthCheck bool
}
EnvVar maintains information about the configuration variable
func GatherInfo ¶ added in v1.10.7
GatherInfo gathers information about the specified struct
type ISecurityStringer ¶ added in v1.10.7
type ISecurityStringer interface {
SecurityString() string
}
type ParseError ¶ added in v1.10.7
A ParseError occurs when an environment variable cannot be converted to the type required by a struct field during assignment.
func (*ParseError) Error ¶ added in v1.10.7
func (e *ParseError) Error() string
type PathWalker ¶
type PathWalker struct {
// contains filtered or unexported fields
}
func NewPathWalker ¶
func NewPathWalker() *PathWalker
func (*PathWalker) Enter ¶
func (pw *PathWalker) Enter(i interface{})
func (*PathWalker) Exit ¶
func (pw *PathWalker) Exit()
func (*PathWalker) Paths ¶
func (pw *PathWalker) Paths() []interface{}
func (*PathWalker) String ¶
func (pw *PathWalker) String() string