-
Notifications
You must be signed in to change notification settings - Fork 7
/
specs.go
46 lines (34 loc) · 1.58 KB
/
specs.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
package config
import "flag"
// EnvSpec is the basic environment configuration setup needed for the app to start
type EnvSpec struct {
OtelGRPCEndpoint string `envconfig:"otel_grpc_endpoint"`
OtelHTTPEndpoint string `envconfig:"otel_http_endpoint"`
TracingEnabled bool `envconfig:"tracing_enabled" default:"true"`
LogLevel string `envconfig:"log_level" default:"error"`
LogFile string `envconfig:"log_file" default:"log.txt"`
Debug bool `envconfig:"debug" default:"false"`
Port int `envconfig:"port" default:"8080"`
BaseURL string `envconfig:"base_url" default:""`
CookiesEncryptionKey string `envconfig:"cookies_encryption_key" required:"true" validate:"required,min=32,max=32"`
CookieTTL int `envconfig:"cookie_ttl" default:"300"`
KratosPublicURL string `envconfig:"kratos_public_url"`
KratosAdminURL string `envconfig:"kratos_admin_url"`
HydraAdminURL string `envconfig:"hydra_admin_url"`
ApiScheme string `envconfig:"openfga_api_scheme" default:""`
ApiHost string `envconfig:"openfga_api_host"`
ApiToken string `envconfig:"openfga_api_token"`
StoreId string `envconfig:"openfga_store_id"`
AuthorizationModelId string `envconfig:"openfga_authorization_model_id" default:""`
AuthorizationEnabled bool `envconfig:"authorization_enabled" default:"false"`
MFAEnabled bool `envconfig:"mfa_enabled" default:"true"`
}
type Flags struct {
ShowVersion bool
}
func NewFlags() *Flags {
f := new(Flags)
flag.BoolVar(&f.ShowVersion, "version", false, "Show the app version and exit")
flag.Parse()
return f
}