Documentation
¶
Overview ¶
Package envar provides syntactic sugar for working with the environment variables. Allows you to describe using structure tags how to use environment variables to fill in this structure.
Index ¶
Constants ¶
View Source
const ( TagEnvExample = "NAME:valueType=defaultValue" CountPartsTagData = 2 CountPartsNameType = 2 )
Variables ¶
This section is empty.
Functions ¶
func Load ¶ added in v0.0.14
func Load(structData interface{}) error
Load field of target struct from flag like described in tags
func NewTagProcessor ¶ added in v0.0.14
func NewTagProcessor() refavour.TagProcessor
Types ¶
type EnvVar ¶
type EnvVar struct { // Key - name environment variable Key string // DefaultValue - default value if environment variable is not set DefaultValue interface{} }
EnvVar describe tag for struct receiver
func (*EnvVar) GetFloat64 ¶ added in v0.0.14
GetFloat64 read float64 value from environment variable ev.Key
Click to show internal directories.
Click to hide internal directories.