flags

package
v1.6.6-alpha.0-fix-poe... Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeprecatedFlag added in v1.4.0

func NewDeprecatedFlag(v Deprecated) *deprecatedFlag

NewDeprecatedFlag returns a flag that returns an error when used.

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 Deprecated added in v1.4.0

type Deprecated interface {
	DeprecatedMsg() string
}

Deprecated is an interface for deprecated config fields. A deprecated config field should implement this interface (with a value receiver) and return a message explaining the deprecation.

type JSONFlag added in v1.4.0

type JSONFlag struct {
	Value any
}

func (*JSONFlag) Set added in v1.4.0

func (f *JSONFlag) Set(v string) error

func (*JSONFlag) String added in v1.4.0

func (f *JSONFlag) String() string

func (*JSONFlag) Type added in v1.4.0

func (f *JSONFlag) Type() string

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