flags

package
v0.0.0-...-73997e6 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolEnvVar

func BoolEnvVar(b *bool, flagName, envVariable string, defaultValue bool, description string)

BoolEnvVar creates bool flag with given parameters. If flag is not provided, it will try to get env variable.

func BoolVar

func BoolVar(b *bool, flagName string, defaultValue bool, description string)

BoolVar creates a bool flag with given parameters.

func DurationEnvVar

func DurationEnvVar(d *time.Duration, flagName, envVariable string, defaultValue time.Duration, description string)

DurationEnvVar creates time.Duration flag with given parameters. If flag is not provided, it will try to get env variable.

func DurationVar

func DurationVar(d *time.Duration, flagName string, defaultValue time.Duration, description string)

DurationVar creates a time.Duration flag with given parameters.

func InitFlagSet

func InitFlagSet()

func IntEnvVar

func IntEnvVar(i *int, flagName, envVariable string, defaultValue int, description string)

IntEnvVar creates int flag with given parameters. If flag is not provided, it will try to get env variable.

func IntVar

func IntVar(i *int, flagName string, defaultValue int, description string)

IntVar creates int flag with given parameters.

func MarkDeprecated

func MarkDeprecated(name string, usageMessage string) error

MarkDeprecated indicates that a flag is deprecated

func Parse

func Parse() error

Parse parses provided flags and env variables.

func StringArrayVar

func StringArrayVar(s *[]string, flagName string, defaultValue []string, description string)

StringArrayVar creates string flag with given parameters. Flag can be used multiple times.

func StringEnvVar

func StringEnvVar(s *string, flagName, envVariable, defaultValue, description string)

StringEnvVar creates string flag with given parameters. If flag is not provided, it will try to get env variable.

func StringSliceEnvVar

func StringSliceEnvVar(s *[]string, flagName, envVariable string, defaultValue []string, description string)

StringSliceEnvVar creates a string slice flag with the given parameters. If the flag is not provided, it will try to get the env variable. Flag accepts multiple values separated by commas.

func StringVar

func StringVar(s *string, flagName, defaultValue, description string)

StringVar creates string flag with given parameters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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