mirror of
https://github.com/spf13/viper
synced 2025-05-07 12:47:18 +00:00
read raw configuration by given bytes
This commit is contained in:
parent
b126443ea3
commit
fc23950253
1 changed files with 7 additions and 0 deletions
7
viper.go
7
viper.go
|
@ -559,6 +559,13 @@ func (v *Viper) ReadInConfig() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReadInRawConfig reads the given raw bytes to load configuration.
|
||||||
|
func ReadInRawConfig(raw []byte) error { return v.ReadInRawConfig(raw) }
|
||||||
|
func (v *Viper) ReadInRawConfig(raw []byte) error {
|
||||||
|
v.marshalReader(bytes.NewReader(raw), v.config)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func ReadRemoteConfig() error { return v.ReadRemoteConfig() }
|
func ReadRemoteConfig() error { return v.ReadRemoteConfig() }
|
||||||
func (v *Viper) ReadRemoteConfig() error {
|
func (v *Viper) ReadRemoteConfig() error {
|
||||||
err := v.getKeyValueConfig()
|
err := v.getKeyValueConfig()
|
||||||
|
|
Loading…
Add table
Reference in a new issue