Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFlagRequired error = errors.New("the flag is required")
)
Functions ¶
Types ¶
type BaseFlag ¶
type BaseFlag[T interfaces.Ordered] struct { // Value is the address of some variable, which can be some pkg variable, for example Value *T // Default is the default value to assign to this variable Default T // EnvName is the name of the environment variable that will try to fetch this data EnvName string // Required is used to check if the value was found in the path. // This is necessary, since that an empty variable can be in the env Required bool }
BaseFlag can be used for the BaseFlagTypes only.
If you don't pass a Default value, the variable will be mandatory
func (*BaseFlag[T]) CurrentValue ¶
func (*BaseFlag[T]) DefaultValue ¶
func (*BaseFlag[T]) IsRequired ¶
Click to show internal directories.
Click to hide internal directories.