Documentation
¶
Index ¶
- func DefaultLoad(viper_ *viper.Viper, v proto.Message, cfgFile string, envPrefix string, ...) error
- func DefaultPersisConfigPath(v *viper.Viper) string
- func LoadGlobalConfig(v proto.Message, cfgFile string, envPrefix string, protos ...proto.Message) error
- func MergeAll(v *viper.Viper, cfgFile string, envPrefix string, protos ...proto.Message) error
- func MergeConfigFromENV(v *viper.Viper, envPrefix string)
- func MergeConfigFromFile(v *viper.Viper, cfgFile string) error
- func MergeConfigFromProtoMessages(v *viper.Viper, configType string, protos ...proto.Message) error
- func PersistConfig(v *viper.Viper) error
- func PersistConfigTo(v *viper.Viper, filename string) error
- func PersistGlobalConfig() error
- func UnmarshalProtoMessageByJsonpb(viper_ *viper.Viper, v proto.Message, opts ...viper.DecoderConfigOption) error
- func UnmarshalProtoMessageByJsonpbHookFunc(def proto.Message) mapstructure.DecodeHookFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLoad ¶
func DefaultLoad(viper_ *viper.Viper, v proto.Message, cfgFile string, envPrefix string, protos ...proto.Message) error
DefaultLoad load config from file and protos into v, and save to a using file load sequence: protos..., file, env, replace if member has been set that is, later cfg appeared, higher priority cfg has
func DefaultPersisConfigPath ¶ added in v1.0.176
DefaultPersisConfigPath returns the given file name to persist as YAML
func LoadGlobalConfig ¶
func LoadGlobalConfig(v proto.Message, cfgFile string, envPrefix string, protos ...proto.Message) error
LoadGlobalConfig load config from the global Viper instance.
func MergeConfigFromENV ¶
MergeConfigFromENV read from env
func MergeConfigFromFile ¶
MergeConfigFromFile read from file
func MergeConfigFromProtoMessages ¶
MergeConfigFromProtoMessages read from protobuf merge protos into viper one by one, replace if member has been set that is, later proto appeared, higher priority proto has
func PersistConfig ¶
PersistConfig writes config using into .use.<name>.yaml
func PersistConfigTo ¶ added in v1.0.176
PersistConfigTo writes the completed component config into the given file name as YAML
func PersistGlobalConfig ¶
func PersistGlobalConfig() error
func UnmarshalProtoMessageByJsonpb ¶
func UnmarshalProtoMessageByJsonpb(viper_ *viper.Viper, v proto.Message, opts ...viper.DecoderConfigOption) error
UnmarshalProtoMessageByJsonpb returns the latest config viper proto
func UnmarshalProtoMessageByJsonpbHookFunc ¶
func UnmarshalProtoMessageByJsonpbHookFunc(def proto.Message) mapstructure.DecodeHookFunc
UnmarshalProtoMessageByJsonpbHookFunc returns a DecodeHookFunc that converts root struct to config.ViperProto. Trick of protobuf, which generates json tag only
Types ¶
This section is empty.