(path string)
| 19 | } |
| 20 | |
| 21 | func LoadConfig(path string) (*conf, error) { |
| 22 | var cfg *conf |
| 23 | viper.SetConfigName("app_config") |
| 24 | viper.SetConfigType("env") |
| 25 | viper.AddConfigPath(path) |
| 26 | viper.SetConfigFile(".env") |
| 27 | viper.AutomaticEnv() |
| 28 | err := viper.ReadInConfig() |
| 29 | if err != nil { |
| 30 | panic(err) |
| 31 | } |
| 32 | err = viper.Unmarshal(&cfg) |
| 33 | if err != nil { |
| 34 | panic(err) |
| 35 | } |
| 36 | cfg.TokenAuth = jwtauth.New("HS256", []byte(cfg.JWTSecret), nil) |
| 37 | return cfg, err |
| 38 | } |
nothing calls this directly
no outgoing calls
no test coverage detected