consul: github.com/hashicorp/consul/command/flags Index | Files

package flags

import "github.com/hashicorp/consul/command/flags"

Index

Package Files

config.go flag_map_value.go flag_slice_value.go http.go merge.go usage.go

Variables

var ConfigDecodeHook = mapstructure.ComposeDecodeHookFunc(
    BoolToBoolValueFunc(),
    StringToDurationValueFunc(),
    StringToStringValueFunc(),
    Float64ToUintValueFunc(),
)

ConfigDecodeHook should be passed to mapstructure in order to decode into the *Value objects here.

func BoolToBoolValueFunc Uses

func BoolToBoolValueFunc() mapstructure.DecodeHookFunc

BoolToBoolValueFunc is a mapstructure hook that looks for an incoming bool mapped to a BoolValue and does the translation.

func Float64ToUintValueFunc Uses

func Float64ToUintValueFunc() mapstructure.DecodeHookFunc

Float64ToUintValueFunc is a mapstructure hook that looks for an incoming float64 mapped to a UintValue and does the translation.

func Merge Uses

func Merge(dst, src *flag.FlagSet)

func StringToDurationValueFunc Uses

func StringToDurationValueFunc() mapstructure.DecodeHookFunc

StringToDurationValueFunc is a mapstructure hook that looks for an incoming string mapped to a DurationValue and does the translation.

func StringToStringValueFunc Uses

func StringToStringValueFunc() mapstructure.DecodeHookFunc

StringToStringValueFunc is a mapstructure hook that looks for an incoming string mapped to a StringValue and does the translation.

func Usage Uses

func Usage(txt string, flags *flag.FlagSet) string

func Visit Uses

func Visit(path string, visitor VisitFn) error

Visit will call the visitor function on the path if it's a file, or for each file in the path if it's a directory. Directories will not be recursed into, and files in the directory will be visited in alphabetical order.

type AppendSliceValue Uses

type AppendSliceValue []string

AppendSliceValue implements the flag.Value interface and allows multiple calls to the same variable to append a list.

func (*AppendSliceValue) Set Uses

func (s *AppendSliceValue) Set(value string) error

func (*AppendSliceValue) String Uses

func (s *AppendSliceValue) String() string

type BoolValue Uses

type BoolValue struct {
    // contains filtered or unexported fields
}

BoolValue provides a flag value that's aware if it has been set.

func (*BoolValue) IsBoolFlag Uses

func (b *BoolValue) IsBoolFlag() bool

IsBoolFlag is an optional method of the flag.Value interface which marks this value as boolean when the return value is true. See flag.Value for details.

func (*BoolValue) Merge Uses

func (b *BoolValue) Merge(onto *bool)

Merge will overlay this value if it has been set.

func (*BoolValue) Set Uses

func (b *BoolValue) Set(v string) error

Set implements the flag.Value interface.

func (*BoolValue) String Uses

func (b *BoolValue) String() string

String implements the flag.Value interface.

type DurationValue Uses

type DurationValue struct {
    // contains filtered or unexported fields
}

DurationValue provides a flag value that's aware if it has been set.

func (*DurationValue) Merge Uses

func (d *DurationValue) Merge(onto *time.Duration)

Merge will overlay this value if it has been set.

func (*DurationValue) Set Uses

func (d *DurationValue) Set(v string) error

Set implements the flag.Value interface.

func (*DurationValue) String Uses

func (d *DurationValue) String() string

String implements the flag.Value interface.

type FlagMapValue Uses

type FlagMapValue map[string]string

FlagMapValue is a flag implementation used to provide key=value semantics multiple times.

func (*FlagMapValue) Set Uses

func (h *FlagMapValue) Set(value string) error

func (*FlagMapValue) String Uses

func (h *FlagMapValue) String() string

type HTTPFlags Uses

type HTTPFlags struct {
    // contains filtered or unexported fields
}

func (*HTTPFlags) APIClient Uses

func (f *HTTPFlags) APIClient() (*api.Client, error)

func (*HTTPFlags) Addr Uses

func (f *HTTPFlags) Addr() string

func (*HTTPFlags) ClientFlags Uses

func (f *HTTPFlags) ClientFlags() *flag.FlagSet

func (*HTTPFlags) Datacenter Uses

func (f *HTTPFlags) Datacenter() string

func (*HTTPFlags) MergeOntoConfig Uses

func (f *HTTPFlags) MergeOntoConfig(c *api.Config)

func (*HTTPFlags) ReadTokenFile Uses

func (f *HTTPFlags) ReadTokenFile() (string, error)

func (*HTTPFlags) ServerFlags Uses

func (f *HTTPFlags) ServerFlags() *flag.FlagSet

func (*HTTPFlags) SetToken Uses

func (f *HTTPFlags) SetToken(v string) error

func (*HTTPFlags) SetTokenFile Uses

func (f *HTTPFlags) SetTokenFile(v string) error

func (*HTTPFlags) Stale Uses

func (f *HTTPFlags) Stale() bool

func (*HTTPFlags) Token Uses

func (f *HTTPFlags) Token() string

func (*HTTPFlags) TokenFile Uses

func (f *HTTPFlags) TokenFile() string

type StringValue Uses

type StringValue struct {
    // contains filtered or unexported fields
}

StringValue provides a flag value that's aware if it has been set.

func (*StringValue) Merge Uses

func (s *StringValue) Merge(onto *string)

Merge will overlay this value if it has been set.

func (*StringValue) Set Uses

func (s *StringValue) Set(v string) error

Set implements the flag.Value interface.

func (*StringValue) String Uses

func (s *StringValue) String() string

String implements the flag.Value interface.

type UintValue Uses

type UintValue struct {
    // contains filtered or unexported fields
}

UintValue provides a flag value that's aware if it has been set.

func (*UintValue) Merge Uses

func (u *UintValue) Merge(onto *uint)

Merge will overlay this value if it has been set.

func (*UintValue) Set Uses

func (u *UintValue) Set(v string) error

Set implements the flag.Value interface.

func (*UintValue) String Uses

func (u *UintValue) String() string

String implements the flag.Value interface.

type Usager Uses

type Usager struct {
    Usage string
    Flags *flag.FlagSet
}

func (*Usager) String Uses

func (u *Usager) String() string

type VisitFn Uses

type VisitFn func(path string) error

VisitFn is a callback that gets a chance to visit each file found during a traversal with visit().

Package flags imports 15 packages (graph) and is imported by 636 packages. Updated 2019-04-27. Refresh now. Tools for package owners.