Documentation
¶
Index ¶
- Constants
- func Cast[T any](settings any) T
- func CopySlice[T any](s []T) []T
- func CopySliceC[T any](s []T, capacity int) []T
- func GetEnvTypesHelp() string
- type BuildType
- type EnvironmentType
- func (v EnvironmentType) MarshalYAML() (any, error)
- func (v *EnvironmentType) Set(s string) (err error)
- func (v EnvironmentType) ShortString() string
- func (v EnvironmentType) String() string
- func (v *EnvironmentType) Type() string
- func (v *EnvironmentType) UnmarshalMapstruct(data any) error
- func (v *EnvironmentType) UnmarshalYAML(unmarshal func(any) error) (err error)
Constants ¶
View Source
const ( // If you change this here -> adjust the `New*` functions. BuildDebug BuildType = 0 BuildRelease BuildType = 1 BuildReleaseName = "release" BuildDebugName = "debug" )
Variables ¶
This section is empty.
Functions ¶
func CopySliceC ¶
CopySlice copies a slice but giving an initial capacity.
func GetEnvTypesHelp ¶
func GetEnvTypesHelp() string
GetEnvTypesHelp reports some help string for env. types.
Types ¶
type BuildType ¶
type BuildType int
func GetAllBuildTypes ¶
func GetAllBuildTypes() []BuildType
func NewBuildType ¶
func NewBuildTypeFromEnv ¶
func NewBuildTypeFromEnv(e EnvironmentType) BuildType
func (BuildType) MarshalYAML ¶
MarshalYAML marshals to YAML. Note: needs to be value-receiver to be called!
func (*BuildType) UnmarshalMapstruct ¶ added in v0.26.0
UnmarshalMapstruct implement the [config.UnmarshalMapstruct] interface.
type EnvironmentType ¶
type EnvironmentType int
const ( EnvironmentDev EnvironmentType = 0 EnvironmentTesting EnvironmentType = 1 EnvironmentStaging EnvironmentType = 2 EnvironmentProd EnvironmentType = 3 )
func NewEnvironmentType ¶
func NewEnvironmentType(s string) (EnvironmentType, error)
func (EnvironmentType) MarshalYAML ¶
func (v EnvironmentType) MarshalYAML() (any, error)
MarshalYAML marshals to YAML. Note: needs to be value-receiver to be called!
func (*EnvironmentType) Set ¶
func (v *EnvironmentType) Set(s string) (err error)
Implement the pflags Value interface.
func (EnvironmentType) ShortString ¶
func (v EnvironmentType) ShortString() string
func (EnvironmentType) String ¶
func (v EnvironmentType) String() string
Implement the pflags Value interface.
func (*EnvironmentType) Type ¶
func (v *EnvironmentType) Type() string
Implement the pflags Value interface.
func (*EnvironmentType) UnmarshalMapstruct ¶ added in v0.26.0
func (v *EnvironmentType) UnmarshalMapstruct(data any) error
Implement the [config.UnmarshalMapstruct] interface.
func (*EnvironmentType) UnmarshalYAML ¶
func (v *EnvironmentType) UnmarshalYAML(unmarshal func(any) error) (err error)
UnmarshalYAML implements the unmarshalling of this data type.
Click to show internal directories.
Click to hide internal directories.