flags

package
v0.0.0-...-0f57273 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

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 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 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