-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.go
85 lines (76 loc) · 3.52 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package config
type SubordinateCertificate struct {
Region string `mapstructure:"region"`
CaArn string `mapstructure:"ca_arn"`
CaActiveDay int `mapstructure:"ca_active_day"`
AssumeRole bool `mapstructure:"assume_role"`
RoleArn string `mapstructure:"role_arn"`
RootCa bool `mapstructure:"root_ca"`
Default bool `mapstructure:"default"`
}
type SubordinateCertificateAuthority struct {
BaseDirectory string `mapstructure:"directory"`
Country string `mapstructure:"country"`
Province string `mapstructure:"province"`
Locality string `mapstructure:"locality"`
Organization string `mapstructure:"organization"`
OrganizationUnit string `mapstructure:"organization_unit"`
Email string `mapstructure:"email"`
SigningAlgorithm string `mapstructure:"signing_algorithm"`
KeyAlgorithm string `mapstructure:"key_algorithm"`
KeySize int `mapstructure:"key_size"`
}
type DatabaseConfig struct {
Driver string `mapstructure:"database_driver"`
Table string `mapstructure:"database_table"`
Endpoint string `mapstructure:"database_endpoint"`
ReaderEndpoint string `mapstructure:"database_reader_endpoint"`
User string `mapstructure:"database_user"`
Port int `mapstructure:"database_port"`
Region string `mapstructure:"region"`
SSLMode string `mapstructure:"ssl_mode"`
}
type RedisConfig struct {
Endpoint string `mapstructure:"cluster_endpoint"`
Port string `mapstructure:"port"`
Duration int `mapstructure:"duration"`
Period int `mapstructure:"period"`
RateLimit int `mapstructure:"rate_limit"`
ExcludeRateLimit []string `mapstructure:"exclude_rate_limit"`
}
type FirehoseConfig struct {
Stream string `mapstructure:"stream"`
Region string `mapstructure:"region"`
}
type KMSConfig struct {
KeyId string `mapstructure:"key_id"`
SigningAlgorithm string `mapstructure:"signing_algorithm"`
Region string `mapstructure:"region"`
AuthValidity int `mapstructure:"auth_validity"`
}
type SecretsManagerConfig struct {
SecretId string `mapstructure:"secret_id"`
Region string `mapstructure:"region"`
}
type Stage struct {
Local []string `mapstructure:"local"`
Sandbox []string `mapstructure:"sandbox"`
Development []string `mapstructure:"development"`
Staging []string `mapstructure:"staging"`
PreProduction []string `mapstructure:"pre_production"`
Production []string `mapstructure:"production"`
Corporate []string `mapstructure:"corporate"`
}
type Config struct {
GRPCServerAddress string `mapstructure:"grpc_server_address"`
OCSPServer []string `mapstructure:"ocsp_server"`
Database DatabaseConfig `mapstructure:"database"`
Redis RedisConfig `mapstructure:"redis"`
KMS KMSConfig `mapstructure:"kms"`
Firehose FirehoseConfig `mapstructure:"firehose"`
Domains []string `mapstructure:"domains"`
ACMPCA map[string]SubordinateCertificate `mapstructure:"acm_pca"`
SecretsManager SecretsManagerConfig `mapstructure:"secrets_manager"`
SubordinateMetadata SubordinateCertificateAuthority `mapstructure:"subordinate_ca_metadata"`
Environment Stage `mapstructure:"certificate_authority"`
}