Documentation
¶
Index ¶
- func EmptyReader() io.Reader
- func MergeConfigFileWithFlags(file string, flagConf *config.Config) (*config.Config, error)
- func NodeFlags(flagConf *config.Config, configFile *string) *pflag.FlagSet
- func NormalizeFlags(f *pflag.FlagSet, name string) pflag.NormalizedName
- func ServerFlags(flagConf *config.Config, configFile *string) *pflag.FlagSet
- func StdinPipe() io.Reader
- func TempConfigFile(c *config.Config, name string) (path string, cleanup func())
- func WorkerFlags(flagConf *config.Config, configFile *string) *pflag.FlagSet
- type DurationValue
- type TimeoutConfigValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyReader ¶
EmptyReader returns an io.Reader which is empty and immediately closed.
func MergeConfigFileWithFlags ¶
MergeConfigFileWithFlags is a util used by server commands that use flags to set Funnel config values. These commands can also take in the path to a Funnel config file. This function ensures that the config gets set up properly. Flag values override values in the provided config file.
func NormalizeFlags ¶
func NormalizeFlags(f *pflag.FlagSet, name string) pflag.NormalizedName
NormalizeFlags allows for flags to be case and separator insensitive. Use it by passing it to cobra.Command.SetGlobalNormalizationFunc
func ServerFlags ¶
ServerFlags returns a new flag set for configuring a Funnel server
func StdinPipe ¶
StdinPipe will return stdin if it's available, otherwise it will return EmptyReader()
func TempConfigFile ¶
TempConfigFile writes the configuration to a temporary file. Returns: - "path" is the path of the file. - "cleanup" can be called to remove the temporary file.
Types ¶
type DurationValue ¶ added in v0.11.4
type DurationValue struct {
D **durationpb.Duration // Pointer to a pointer to handle struct fields
}
DurationValue is a pflag.Value implementation for durationpb.Duration.
func (*DurationValue) Set ¶ added in v0.11.4
func (d *DurationValue) Set(s string) error
Set parses a string into a durationpb.Duration.
func (*DurationValue) String ¶ added in v0.11.4
func (d *DurationValue) String() string
String returns the string representation of the duration.
func (*DurationValue) Type ¶ added in v0.11.4
func (d *DurationValue) Type() string
Type returns the flag type.
type TimeoutConfigValue ¶ added in v0.11.4
type TimeoutConfigValue struct {
TC **config.TimeoutConfig // Pointer to a pointer to handle struct fields
}
TimeoutConfigValue is a pflag.Value implementation for config.TimeoutConfig.
func (*TimeoutConfigValue) Set ¶ added in v0.11.4
func (tcv *TimeoutConfigValue) Set(s string) error
Set parses a string into a config.TimeoutConfig.
func (*TimeoutConfigValue) String ¶ added in v0.11.4
func (tcv *TimeoutConfigValue) String() string
String returns the string representation of the TimeoutConfig.
func (*TimeoutConfigValue) Type ¶ added in v0.11.4
func (tcv *TimeoutConfigValue) Type() string
Type returns the flag type.