Documentation ¶
Index ¶
- func ArrayValueFlagFrom[T any](singleFlag func(*T) *ValueFlag[T]) func(*[]T) *ArrayValueFlag[T]
- type ArrayValueFlag
- type KeyValueParser
- type KeyValueStringer
- type MapValueFlag
- type Parser
- type Stringer
- type TargetingMode
- type ValueFlag
- func DataLocalityFlag(value *semantic.JobSelectionDataLocality) *ValueFlag[semantic.JobSelectionDataLocality]
- func LoggingFlag(value *logger.LogMode) *ValueFlag[logger.LogMode]
- func NetworkFlag(value *models.Network) *ValueFlag[models.Network]
- func OutputFormatFlag(value *output.OutputFormat) *ValueFlag[output.OutputFormat]
- func StorageTypeFlag(value *types.StorageType) *ValueFlag[types.StorageType]
- func TargetingFlag(value *TargetingMode) *ValueFlag[TargetingMode]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayValueFlagFrom ¶
func ArrayValueFlagFrom[T any](singleFlag func(*T) *ValueFlag[T]) func(*[]T) *ArrayValueFlag[T]
Converts a value flag into a flag that can accept multiple of the same value.
Types ¶
type ArrayValueFlag ¶
type ArrayValueFlag[T any] struct { // contains filtered or unexported fields }
An ArrayValueFlag is like a ValueFlag except it will add the command line value into a slice of values, and hence can be used for flags that are meant to appear multiple times.
func NewIPFSStorageSpecArrayFlag ¶
func NewIPFSStorageSpecArrayFlag(value *[]*models.InputSource) *ArrayValueFlag[*models.InputSource]
func NewURLStorageSpecArrayFlag ¶
func NewURLStorageSpecArrayFlag(value *[]*models.InputSource) *ArrayValueFlag[*models.InputSource]
func ResultPathFlag ¶ added in v1.4.0
func ResultPathFlag(value *[]*models.ResultPath) *ArrayValueFlag[*models.ResultPath]
func (*ArrayValueFlag[T]) Set ¶
func (s *ArrayValueFlag[T]) Set(input string) error
Set implements pflag.Value
func (*ArrayValueFlag[T]) String ¶
func (s *ArrayValueFlag[T]) String() string
String implements pflag.Value
func (*ArrayValueFlag[T]) Type ¶
func (s *ArrayValueFlag[T]) Type() string
Type implements pflag.Value
type KeyValueParser ¶
type KeyValueParser[K comparable, V any] func(string) (K, V, error)
A KeyValueParser is like a Parser except that it returns two values representing a key and a value.
func SeparatorParser ¶ added in v1.2.0
func SeparatorParser(sep string) KeyValueParser[string, string]
type KeyValueStringer ¶
type KeyValueStringer[K comparable, V any] func(*K, *V) string
A KeyValueStringer is like a Stringer except that it converts native objects representing a key and a value into a string.
type MapValueFlag ¶
type MapValueFlag[K comparable, V any] struct { // contains filtered or unexported fields }
A MapValueFlag is like a ValueFlag except it will add the command line value into a map of values, and hence can be used for flags that are meant to appear multiple times and represent a key-value structure.
func (*MapValueFlag[K, V]) Set ¶
func (s *MapValueFlag[K, V]) Set(input string) error
Set implements pflag.Value
func (*MapValueFlag[K, V]) String ¶
func (s *MapValueFlag[K, V]) String() string
String implements pflag.Value
func (*MapValueFlag[K, V]) Type ¶
func (s *MapValueFlag[K, V]) Type() string
Type implements pflag.Value
type TargetingMode ¶ added in v1.5.0
type TargetingMode bool
const ( TargetAny TargetingMode = false TargetAll TargetingMode = true )
func ParseTargetingMode ¶ added in v1.5.0
func ParseTargetingMode(s string) (TargetingMode, error)
func (TargetingMode) String ¶ added in v1.5.0
func (t TargetingMode) String() string
type ValueFlag ¶
type ValueFlag[T any] struct { // contains filtered or unexported fields }
A ValueFlag is a pflag.Value that knows how to take a command line value represented as a string and set it as a native object into a struct.
func DataLocalityFlag ¶
func DataLocalityFlag(value *semantic.JobSelectionDataLocality) *ValueFlag[semantic.JobSelectionDataLocality]
func OutputFormatFlag ¶
func OutputFormatFlag(value *output.OutputFormat) *ValueFlag[output.OutputFormat]
func StorageTypeFlag ¶
func StorageTypeFlag(value *types.StorageType) *ValueFlag[types.StorageType]
func TargetingFlag ¶
func TargetingFlag(value *TargetingMode) *ValueFlag[TargetingMode]