Documentation ¶
Index ¶
- Variables
- func ArrayValueFlagFrom[T any](singleFlag func(*T) *ValueFlag[T]) func(*[]T) *ArrayValueFlag[T]
- func DisabledFeatureCLIFlags(config *node.FeatureConfig) *pflag.FlagSet
- func JobSelectionCLIFlags(policy *node.JobSelectionPolicy) *pflag.FlagSet
- type ArrayValueFlag
- func ExcludedTagFlag(value *[]model.ExcludedTag) *ArrayValueFlag[model.ExcludedTag]
- func IncludedTagFlag(value *[]model.IncludedTag) *ArrayValueFlag[model.IncludedTag]
- func NewIPFSStorageSpecArrayFlag(value *[]model.StorageSpec) *ArrayValueFlag[model.StorageSpec]
- func NewURLStorageSpecArrayFlag(value *[]model.StorageSpec) *ArrayValueFlag[model.StorageSpec]
- type KeyValueParser
- type KeyValueStringer
- type MapValueFlag
- type Parser
- type Stringer
- type ValueFlag
- func DataLocalityFlag(value *semantic.JobSelectionDataLocality) *ValueFlag[semantic.JobSelectionDataLocality]
- func EngineFlag(value *string) *ValueFlag[string]
- func LoggingFlag(value *logger.LogMode) *ValueFlag[logger.LogMode]
- func NetworkFlag(value *model.Network) *ValueFlag[model.Network]
- func OutputFormatFlag(value *output.OutputFormat) *ValueFlag[output.OutputFormat]
- func PublisherFlag(value *string) *ValueFlag[string]
- func StorageSourceFlag(value *string) *ValueFlag[string]
- func StorageTypeFlag(value *types.StorageType) *ValueFlag[types.StorageType]
- func TargetingFlag(value *model.TargetingMode) *ValueFlag[model.TargetingMode]
- func URLFlag(value **url.URL, schemes ...string) *ValueFlag[*url.URL]
Constants ¶
This section is empty.
Variables ¶
var ( EnginesFlag = ArrayValueFlagFrom(EngineFlag) PublishersFlag = ArrayValueFlagFrom(PublisherFlag) StorageSourcesFlag = ArrayValueFlagFrom(StorageSourceFlag) )
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.
func DisabledFeatureCLIFlags ¶
func DisabledFeatureCLIFlags(config *node.FeatureConfig) *pflag.FlagSet
func JobSelectionCLIFlags ¶
func JobSelectionCLIFlags(policy *node.JobSelectionPolicy) *pflag.FlagSet
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 ExcludedTagFlag ¶
func ExcludedTagFlag(value *[]model.ExcludedTag) *ArrayValueFlag[model.ExcludedTag]
func IncludedTagFlag ¶
func IncludedTagFlag(value *[]model.IncludedTag) *ArrayValueFlag[model.IncludedTag]
func NewIPFSStorageSpecArrayFlag ¶
func NewIPFSStorageSpecArrayFlag(value *[]model.StorageSpec) *ArrayValueFlag[model.StorageSpec]
func NewURLStorageSpecArrayFlag ¶
func NewURLStorageSpecArrayFlag(value *[]model.StorageSpec) *ArrayValueFlag[model.StorageSpec]
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.
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 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 EngineFlag ¶
func OutputFormatFlag ¶
func OutputFormatFlag(value *output.OutputFormat) *ValueFlag[output.OutputFormat]
func PublisherFlag ¶
func StorageSourceFlag ¶
func StorageTypeFlag ¶
func StorageTypeFlag(value *types.StorageType) *ValueFlag[types.StorageType]
func TargetingFlag ¶
func TargetingFlag(value *model.TargetingMode) *ValueFlag[model.TargetingMode]