util

package
v0.0.0-...-a514ca2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 9 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

This section is empty.

Jump to

Keyboard shortcuts

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