flags

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastStringToMapStringUint64

func CastStringToMapStringUint64(value string) map[string]uint64

CastStringToMapStringUint64 casts string with comma separated values to map[string]uint64. Nil is returned if value fails format validation (consistnt with viper behavior).

Types

type AddressListValue added in v1.3.0

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

AddressListValue wraps an AddressList to make it possible to use it like a slice value in pflag.

func NewAddressListValue added in v1.3.0

func NewAddressListValue(val p2p.AddressList, p *p2p.AddressList) *AddressListValue

NewAddressListValue creates an AddressListValue that wraps the specified AddressList.

func (*AddressListValue) Append added in v1.3.0

func (alv *AddressListValue) Append(val string) error

Append implements pflag.SliceValue.

func (*AddressListValue) GetSlice added in v1.3.0

func (alv *AddressListValue) GetSlice() []string

GetSlice implements pflag.SliceValue.

func (*AddressListValue) Replace added in v1.3.0

func (alv *AddressListValue) Replace(val []string) error

Replace implements pflag.SliceValue.

func (*AddressListValue) Set added in v1.3.0

func (alv *AddressListValue) Set(val string) error

Set implements pflag.Value.

func (*AddressListValue) String added in v1.3.0

func (alv *AddressListValue) String() string

String implements pflag.Value.

func (*AddressListValue) Type added in v1.3.0

func (alv *AddressListValue) Type() string

Type implements pflag.Value.

type StringToUint64Value

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

StringToUint64Value is a flag type for string to uint64 values.

func NewStringToUint64Value

func NewStringToUint64Value(p map[string]uint64) *StringToUint64Value

NewStringToUint64Value creates instance.

func (*StringToUint64Value) Set

func (s *StringToUint64Value) Set(val string) error

Set expects value as "smth=101,else=102".

func (*StringToUint64Value) String

func (s *StringToUint64Value) String() string

String marshals value of the StringToUint64Value instance.

func (*StringToUint64Value) Type

func (s *StringToUint64Value) Type() string

Type returns stringToUint64 type.

Jump to

Keyboard shortcuts

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