util

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyReader

func EmptyReader() io.Reader

EmptyReader returns an io.Reader which is empty and immediately closed.

func MergeConfigFileWithFlags

func MergeConfigFileWithFlags(file string, flagConf *config.Config) (*config.Config, error)

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 NodeFlags

func NodeFlags(flagConf *config.Config, configFile *string) *pflag.FlagSet

NodeFlags returns a new flag set for configuring a Funnel node

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

func ServerFlags(flagConf *config.Config, configFile *string) *pflag.FlagSet

ServerFlags returns a new flag set for configuring a Funnel server

func StdinPipe

func StdinPipe() io.Reader

StdinPipe will return stdin if it's available, otherwise it will return EmptyReader()

func TempConfigFile

func TempConfigFile(c *config.Config, name string) (path string, cleanup func())

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.

func WorkerFlags

func WorkerFlags(flagConf *config.Config, configFile *string) *pflag.FlagSet

WorkerFlags returns a new flag set for configuring a Funnel worker

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL