diff options
Diffstat (limited to 'api/api.go')
-rw-r--r-- | api/api.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -7,6 +7,22 @@ import ( | |||
7 | "github.com/gin-gonic/gin" | 7 | "github.com/gin-gonic/gin" |
8 | ) | 8 | ) |
9 | 9 | ||
10 | var CONFIG Config | ||
11 | |||
12 | type Config struct { | ||
13 | JwtSecret string `toml:"jwt_secret"` | ||
14 | PasswordResetSecret string `toml:"password_reset_secret"` | ||
15 | FreeSMSUser string `toml:"free_sms_user"` | ||
16 | FreeSMSPass string `toml:"free_sms_pass"` | ||
17 | } | ||
18 | |||
19 | func SetConfig(config Config) { | ||
20 | CONFIG = config | ||
21 | |||
22 | JWT_SECRET = []byte(config.JwtSecret) | ||
23 | PASSWORD_RESET_SECRET = []byte(config.PasswordResetSecret) | ||
24 | } | ||
25 | |||
10 | type Error struct { | 26 | type Error struct { |
11 | Code ErrorCode | 27 | Code ErrorCode |
12 | UserMessage string | 28 | UserMessage string |