forked from razonyang/clevergo-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
50 lines (44 loc) · 1.33 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package core
type Config struct {
HTTP ServerConfig `koanf:"http"`
API ServerConfig `koanf:"api"`
Params Params `koanf:"params"`
DB DBConfig `koanf:"db"`
View ViewConfig `koanf:"view"`
Session SessionConfig `koanf:"session"`
I18N I18NConfig `koanf:"i18n"`
Mailer MailerConfig `koanf:"mailer"`
Captcha CaptchaConfig `koanf:"captcha"`
Migration MigrationConfig `koanf:"migration"`
CORS CORSConfig `koanf:"cors"`
CSRF CSRFConfig `koanf:"csrf"`
JWT JWTConfig `koanf:"jwt"`
Redis RedisConfig `koanf:"redis"`
Log LogConfig `koanf:"log"`
}
type ServerConfig struct {
Addr string `koanf:"addr"`
Root string `koanf:"root"`
}
type MigrationConfig struct {
DB string `koanf:"db"`
Driver string `koanf:"driver"`
DSN string `koanf:"dsn"`
Path string `koanf:"path"`
}
type RedisConfig struct {
Host string `koanf:"host"`
Port int `koanf:"port"`
Password string `koanf:"password"`
Database int `koanf:"database"`
}
type JWTConfig struct {
SecretKey string `koanf:"secret_key"`
Duration int `konaf:"duration"`
}
type I18NConfig struct {
Path string `koanf:"path"`
Fallback string `koanf:"fallback"`
Param string `koanf:"param"`
CookieParam string `koanf:"cookie_param"`
}