flagutil

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtrValue

func BoolPtrValue(val *bool, p **bool) pflag.Value

func DurationpbSliceValue

func DurationpbSliceValue(val []time.Duration, p *[]*durationpb.Duration) pflag.Value

func DurationpbValue

func DurationpbValue(val *time.Duration, p **durationpb.Duration) pflag.Value

func EnumValue added in v0.12.0

func EnumValue[T protoenum[T]](p *T) pflag.Value

func FloatPtrValue added in v0.12.0

func FloatPtrValue[T constraints.Float](val *T, p **T) pflag.Value

func IPNetSliceValue

func IPNetSliceValue(val []string, p *[]string) pflag.Value

func IPNetValue

func IPNetValue(val string, p *string) pflag.Value

func IntPtrValue added in v0.12.0

func IntPtrValue[T constraints.Signed](val *T, p **T) pflag.Value

func LoadDefaults added in v0.12.0

func LoadDefaults[T interface {
	FlagSet(...string) *pflag.FlagSet
}](obj T)

func ParseDurationWithExtendedUnits

func ParseDurationWithExtendedUnits(s string) (time.Duration, error)

func Ptr added in v0.12.0

func Ptr[T any](t T) *T

func SetDefValue added in v0.12.0

func SetDefValue(fs *pflag.FlagSet, name, value string)

Sets DefValue and calls Value.Set for a flag. Must only be used after calling AddFlagSet and before calling Parse.

func StringPtrValue added in v0.12.0

func StringPtrValue(val *string, p **string) pflag.Value

func StringToFloat64Value

func StringToFloat64Value(val map[string]float64, p *map[string]float64) pflag.Value

func TimestamppbValue

func TimestamppbValue(val *string, p **timestamppb.Timestamp) pflag.Value

func UintPtrValue added in v0.12.0

func UintPtrValue[T constraints.Unsigned](val *T, p **T) pflag.Value

Types

This section is empty.

Jump to

Keyboard shortcuts

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