-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
41 lines (34 loc) · 1.36 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
package config
import "github.com/code-cage-dev/api/clients/github"
type I18n struct {
Fallback string `env:"I18N_FALLBACK_LANGUAGE" envDefault:"en"`
Dir string `env:"I18N_DIR" envDefault:"./src/locales"`
Locales []string `env:"I18N_LOCALES" envDefault:"en,tr"`
}
type Cors struct {
AllowedOrigins string `env:"CORS_ALLOWED_ORIGINS" envDefault:"*"`
AllowedMethods string `env:"CORS_ALLOWED_METHODS" envDefault:"GET,POST,PUT,DELETE,OPTIONS"`
AllowedHeaders string `env:"CORS_ALLOWED_HEADERS" envDefault:"*"`
AllowCredentials bool `env:"CORS_ALLOW_CREDENTIALS" envDefault:"true"`
}
type HttpServer struct {
Host string `env:"HTTP_SERVER_HOST" envDefault:"localhost"`
Port int `env:"HTTP_SERVER_PORT" envDefault:"3000"`
Domain string `env:"HTTP_SERVER_DOMAIN" envDefault:"localhost"`
}
type Postgres struct {
Host string `env:"POSTGRES_HOST" envDefault:"localhost"`
Port string `env:"POSTGRES_PORT" envDefault:"5432"`
Database string `env:"POSTGRES_DATABASE" envDefault:"postgres"`
Username string `env:"POSTGRES_USERNAME" envDefault:"postgres"`
Password string `env:"POSTGRES_PASSWORD" envDefault:"postgres"`
Migrate bool `env:"POSTGRES_MIGRATE" envDefault:"true"`
Seed bool `env:"POSTGRES_SEED" envDefault:"true"`
}
type App struct {
I18n I18n
Http HttpServer
Postgres Postgres
Github github.Config
Cors Cors
}