flags

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2021 License: MPL-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolValue

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

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

func (*BoolValue) Merge

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

Merge will overlay this value if it has been set.

func (*BoolValue) Set

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

Set implements the flag.Value interface.

func (*BoolValue) String

func (b *BoolValue) String() string

String implements the flag.Value interface.

type DurationValue

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

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

func (*DurationValue) Merge

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

Merge will overlay this value if it has been set.

func (*DurationValue) Set

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

Set implements the flag.Value interface.

func (*DurationValue) String

func (d *DurationValue) String() string

String implements the flag.Value interface.

type FuncBoolVar

type FuncBoolVar func(b bool) error

FuncBoolVar is a type of flag that accepts a function, converts the user's value to a bool, and then calls the given function.

func (FuncBoolVar) IsBoolFlag

func (f FuncBoolVar) IsBoolFlag() bool

func (FuncBoolVar) Set

func (f FuncBoolVar) Set(s string) error

func (FuncBoolVar) String

func (f FuncBoolVar) String() string

type FuncDurationVar

type FuncDurationVar func(d time.Duration) error

FuncDurationVar is a type of flag that accepts a function, converts the user's value to a duration, and then calls the given function.

func (FuncDurationVar) IsBoolFlag

func (f FuncDurationVar) IsBoolFlag() bool

func (FuncDurationVar) Set

func (f FuncDurationVar) Set(s string) error

func (FuncDurationVar) String

func (f FuncDurationVar) String() string

type FuncOptionalStringVar

type FuncOptionalStringVar func(s string) error

FuncOptionalStringVar is a flag that accepts a function which it calls on the optional string given by the user.

func (FuncOptionalStringVar) IsBoolFlag

func (f FuncOptionalStringVar) IsBoolFlag() bool

func (FuncOptionalStringVar) Set

func (FuncOptionalStringVar) String

func (f FuncOptionalStringVar) String() string

type FuncVar

type FuncVar func(s string) error

FuncVar is a type of flag that accepts a function that is the string given by the user.

func (FuncVar) IsBoolFlag

func (f FuncVar) IsBoolFlag() bool

func (FuncVar) Set

func (f FuncVar) Set(s string) error

func (FuncVar) String

func (f FuncVar) String() string

type StringFlag

type StringFlag []string

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

func (*StringFlag) Set

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

func (*StringFlag) String

func (s *StringFlag) String() string

type UintValue

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

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

func (*UintValue) Merge

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

Merge will overlay this value if it has been set.

func (*UintValue) Set

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

Set implements the flag.Value interface.

func (*UintValue) String

func (u *UintValue) String() string

String implements the flag.Value interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL