-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodule.go
41 lines (35 loc) · 932 Bytes
/
module.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
package config
import (
"go.uber.org/fx"
)
// Module ...
var Module = fx.Provide(ImportConfigs)
// Postgres configuration
type Postgres struct {
Username string `json:"username"`
Password string `json:"password"`
Host string `json:"host"`
Port uint16 `json:"port"`
SSLMode string `mapstructure:"ssl_mode"`
DatabaseName string `mapstructure:"database_name"`
}
// Server configuration
type Server struct {
Host string `json:"host"`
Port uint16 `json:"port"`
SecretKey string `mapstructure:"secret_key"`
}
type Logger struct {
Path string `json:"path"`
Level string `json:"level"`
}
// Config — struct is designed to combine the
// structures used
//
// Add or remove structures that are contained
// in your `config.json` file to this structure
type Config struct {
Postgres Postgres `json:"postgres"`
Server Server `json:"server"`
Logger Logger `json:"loger"`
}