Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SliceFlag ¶
type SliceFlag[T any] struct { builder.StaticFlag[[]T] // contains filtered or unexported fields }
SliceFlag is the user‐facing builder for slice flags.
func RegisterSlice ¶
func RegisterSlice[T any]( reg core.Registry, name, usage string, val sliceValueProvider[T], ptr *[]T, ) *SliceFlag[T]
RegisterSlice registers a slice flag.
func (*SliceFlag[T]) Default ¶ added in v0.0.42
func (f *SliceFlag[T]) Default() []T
Default returns the default value.
type SliceValue ¶
type SliceValue[T any] struct { // contains filtered or unexported fields }
SliceValue implements slice flag parsing and validation.
func NewSliceValue ¶
func NewSliceValue[T any]( ptr *[]T, def []T, parse func(string) (T, error), format func(T) string, delimiter string, ) *SliceValue[T]
NewSliceValue creates a new slice value.
func (*SliceValue[T]) Base ¶
func (v *SliceValue[T]) Base() *SliceValue[T]
Base returns the underlying value.
func (*SliceValue[T]) Changed ¶
func (v *SliceValue[T]) Changed() bool
Changed returns true if the value was changed.
func (*SliceValue[T]) Default ¶
func (f *SliceValue[T]) Default() string
Default returns the default value as string.
func (*SliceValue[T]) Get ¶
func (v *SliceValue[T]) Get() any
Get returns the parsed slice for the given ID.
func (*SliceValue[T]) IsSlice ¶ added in v0.0.19
func (v *SliceValue[T]) IsSlice()
isSlice is a no-op marker method to implement core.SliceMarker.
func (*SliceValue[T]) Set ¶
func (v *SliceValue[T]) Set(s string) error
Set parses and stores the slice from a delimited string for a given ID.
Click to show internal directories.
Click to hide internal directories.