Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFlagsFromEnv ¶
SetFlagsFromEnv parses all registered flags in the given flagset, and if they are not already set it attempts to set their values from environment variables. Environment variables take the name of the flag but are UPPERCASE, and any dashes are replaced by underscores. Environment variables additionally are prefixed by the given string followed by and underscore. For example, if prefix=PREFIX: some-flag => PREFIX_SOME_FLAG
Types ¶
type Base64 ¶
type Base64 struct {
// contains filtered or unexported fields
}
Base64 implements flag.Value, and is used to populate []byte values from baes64 encoded strings.
func NewBase64 ¶
NewBase64 returns a Base64 which accepts values which decode to len byte strings.
func (*Base64) Bytes ¶
Bytes returns the set []byte value. If no value has been set, a nil []byte is returned.
func (*Base64) Set ¶
Set will set the []byte value of the Base64 to the base64 decoded values of the string, returning an error if it cannot be decoded or is of the wrong length.
type Base64List ¶
type Base64List struct {
// contains filtered or unexported fields
}
Base64List implements flag.Value and is used to populate [][]byte values from a comma-separated list of base64 encoded strings.
func NewBase64List ¶
func NewBase64List(len int) *Base64List
NewBase64List returns a Base64List which accepts a comma-separated list of strings which must decode to len byte strings.
func (*Base64List) BytesSlice ¶
func (f *Base64List) BytesSlice() [][]byte
func (*Base64List) Set ¶
func (f *Base64List) Set(ss string) error
Set will set the [][]byte value of the Base64List to the base64 decoded values of the comma-separated strings, returning an error on the first error it encounters.
func (*Base64List) String ¶
func (f *Base64List) String() string