|
1 | 1 | package conf |
2 | 2 |
|
3 | 3 | type Database struct { |
4 | | - Type string `json:"type" env:"A_LIST_DB_TYPE"` |
5 | | - User string `json:"user" env:"A_LIST_DB_USER"` |
6 | | - Password string `json:"password" env:"A_LIST_DB_PASS"` |
7 | | - Host string `json:"host" env:"A_LIST_DB_HOST"` |
8 | | - Port int `json:"port" env:"A_LIST_DB_PORT"` |
9 | | - Name string `json:"name" env:"A_LIST_DB_NAME"` |
10 | | - TablePrefix string `json:"table_prefix" env:"A_LIST_DB_TABLE_PREFIX"` |
11 | | - DBFile string `json:"db_file" env:"A_LIST_DB_FILE"` |
12 | | - SslMode string `json:"ssl_mode" env:"A_LIST_SLL_MODE"` |
| 4 | + Type string `json:"type" env:"DB_TYPE"` |
| 5 | + Host string `json:"host" env:"DB_HOST"` |
| 6 | + Port int `json:"port" env:"DB_PORT"` |
| 7 | + User string `json:"user" env:"DB_USER"` |
| 8 | + Password string `json:"password" env:"DB_PASS"` |
| 9 | + Name string `json:"name" env:"DB_NAME"` |
| 10 | + DBFile string `json:"db_file" env:"DB_FILE"` |
| 11 | + TablePrefix string `json:"table_prefix" env:"DB_TABLE_PREFIX"` |
| 12 | + SslMode string `json:"ssl_mode" env:"DB_SLL_MODE"` |
13 | 13 | } |
14 | 14 |
|
15 | 15 | type Scheme struct { |
16 | | - Https bool `json:"https" env:"A_LIST_HTTPS"` |
17 | | - CertFile string `json:"cert_file" env:"A_LIST_CERT"` |
18 | | - KeyFile string `json:"key_file" env:"A_LIST_KEY"` |
| 16 | + Https bool `json:"https" env:"HTTPS"` |
| 17 | + CertFile string `json:"cert_file" env:"CERT_FILE"` |
| 18 | + KeyFile string `json:"key_file" env:"KEY_FILE"` |
19 | 19 | } |
20 | 20 |
|
21 | 21 | type CacheConfig struct { |
22 | | - Expiration int64 `json:"expiration" env:"A_LIST_EXPIRATION"` |
23 | | - CleanupInterval int64 `json:"cleanup_interval" env:"A_LIST_CLEANUP_INTERVAL"` |
| 22 | + Expiration int64 `json:"expiration" env:"CACHE_EXPIRATION"` |
| 23 | + CleanupInterval int64 `json:"cleanup_interval" env:"CLEANUP_INTERVAL"` |
24 | 24 | } |
25 | 25 |
|
26 | 26 | type Config struct { |
27 | 27 | Force bool `json:"force"` |
28 | | - Address string `json:"address" env:"A_LIST_ADDR"` |
29 | | - Port int `json:"port" env:"A_LIST_PORT"` |
30 | | - Assets string `json:"assets" env:"A_LIST_ASSETS"` |
| 28 | + Address string `json:"address" env:"ADDR"` |
| 29 | + Port int `json:"port" env:"PORT"` |
| 30 | + Assets string `json:"assets" env:"ASSETS"` |
31 | 31 | Database Database `json:"database"` |
32 | 32 | Scheme Scheme `json:"scheme"` |
33 | 33 | Cache CacheConfig `json:"cache"` |
34 | | - TempDir string `json:"temp_dir" env:"A_LIST_TEMP_DIR"` |
| 34 | + TempDir string `json:"temp_dir" env:"TEMP_DIR"` |
35 | 35 | } |
36 | 36 |
|
37 | 37 | func DefaultConfig() *Config { |
|
0 commit comments