Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEnvEmptyPrefixAndSuffix = errors.New("env: prefix or suffix cannot be empty")
var ErrEnvInvalidStructure = errors.New("env: invalid structure")
Functions ¶
This section is empty.
Types ¶
type AffixedEnvFeeder ¶
AffixedEnvFeeder is a feeder that reads environment variables with a prefix and/or suffix
func NewAffixedEnvFeeder ¶
func NewAffixedEnvFeeder(prefix, suffix string) AffixedEnvFeeder
func (AffixedEnvFeeder) Feed ¶
func (f AffixedEnvFeeder) Feed(structure interface{}) error
type DotEnvFeeder ¶
DotEnvFeeder is a feeder that reads .env files
func NewDotEnvFeeder ¶
func NewDotEnvFeeder(filePath string) DotEnvFeeder
type EnvFeeder ¶
EnvFeeder is a feeder that reads environment variables
func NewEnvFeeder ¶
func NewEnvFeeder() EnvFeeder
type JsonFeeder ¶
JsonFeeder is a feeder that reads JSON files
func NewJsonFeeder ¶
func NewJsonFeeder(filePath string) JsonFeeder
func (JsonFeeder) FeedKey ¶
func (j JsonFeeder) FeedKey(key string, target interface{}) error
FeedKey reads a JSON file and extracts a specific key
type TenantAffixedEnvFeeder ¶ added in v1.1.0
type TenantAffixedEnvFeeder struct { *AffixedEnvFeeder SetPrefixFunc func(string) SetSuffixFunc func(string) }
func NewTenantAffixedEnvFeeder ¶ added in v1.1.0
func NewTenantAffixedEnvFeeder(prefix, suffix func(string) string) TenantAffixedEnvFeeder
NewTenantAffixedEnvFeeder creates a new TenantAffixedEnvFeeder with the given prefix and suffix functions The prefix and suffix functions are used to modify the prefix and suffix of the environment variables before they are used to set the struct fields The prefix and suffix functions should take a string and return a string The prefix function is used to modify the prefix of the environment variables The suffix function is used to modify the suffix of the environment variables
type TomlFeeder ¶
TomlFeeder is a feeder that reads TOML files
func NewTomlFeeder ¶
func NewTomlFeeder(filePath string) TomlFeeder
func (TomlFeeder) FeedKey ¶
func (t TomlFeeder) FeedKey(key string, target interface{}) error
FeedKey reads a TOML file and extracts a specific key
type YamlFeeder ¶
YamlFeeder is a feeder that reads YAML files
func NewYamlFeeder ¶
func NewYamlFeeder(filePath string) YamlFeeder
func (YamlFeeder) FeedKey ¶
func (y YamlFeeder) FeedKey(key string, target interface{}) error
FeedKey reads a YAML file and extracts a specific key