Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ValueTag is used to mark fields for automatic injection of config values. // Note: Unlike the autowire tag, it is only for injecting config values. // Example: `value:"${key:default}"` ValueTag = "value" // DecodeTag is used for mapstructure decoding of complex types (structs, maps, slices). // It allows both "mapstructure" and "json" tags to be used for field names. DecodeTag = "json,mapstructure" )
View Source
const (
AutowireTag = "autowire" // tag for autowiring fields
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ValueExpr ¶ added in v4.6.0
type ValueExpr struct {
Key string // Config key to look up
Default string // Fallback literal used when the key is absent; empty means "keep the zero value"
Required bool // Set by the "?" sentinel (`${key:?}`): an absent key fails start-up
}
ValueExpr is the parsed form of a `value:"${key:default}"` tag.
func ParseValueExpr ¶ added in v4.6.0
ParseValueExpr parses a value tag of the form ${key}, ${key:default} or ${key:?}.
Click to show internal directories.
Click to hide internal directories.