From 32d4132b2b4134ac76873f77a891e49b69afddc5 Mon Sep 17 00:00:00 2001 From: Kalaiselvan Nadar Date: Thu, 1 Aug 2019 13:35:27 -0700 Subject: [PATCH] Added GetMap and GetMapString method to config --- config/config.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/config.go b/config/config.go index 84a953c..2a86aa9 100644 --- a/config/config.go +++ b/config/config.go @@ -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) +}