Skip to content

Commit

Permalink
Added GetMap and GetMapString method to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalaiselvan Nadar authored and Kalaiselvan Nadar committed Aug 1, 2019
1 parent cbde78c commit 32d4132
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ func (config *Config) GetString(key string) string {
func (config *Config) GetInt(key string) int {
return config.viper.GetInt(key)
}

//GetMapString returns the value associated with the key as a map of strings
func (config *Config) GetMapString(key string) map[string]string {
return config.viper.GetStringMapString(key)
}

//GetgMap returns the value associated with the key as a map of interfaces
func (config *Config) GetgMap(key string) map[string]interface{} {
return config.viper.GetStringMap(key)
}

0 comments on commit 32d4132

Please sign in to comment.