This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
broker.go
56 lines (49 loc) · 2.25 KB
/
broker.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
package types
type CdnPlanOptions struct {
Domain string `json:"domain"`
Origin string `json:"origin"`
Path string `json:"path"`
InsecureOrigin bool `json:"insecure_origin"`
Cookies bool `json:"cookies"`
Headers []string `json:"headers"`
Cdn bool `json:"cdn"`
}
type DomainPlanOptions struct {
Domains []Domain `json:"domains"`
}
type DomainString struct {
Domains []string `json:"domains"`
}
// todo (mxplusb): finish plumbing all of this.
type RuntimeSettings struct {
ALBNames []string `envconfig:"alb_names" required:"true"`
AcmeUrl string `envconfig:"acme_url" required:"true"`
AwsAccessKeyId string `envconfig:"aws_access_key_id" required:"true"`
AwsDefaultRegion string `envconfig:"aws_default_region" required:"true"`
AwsSecretAccessKey string `envconfig:"aws_secret_access_key" required:"true"`
BrokerPassword string `envconfig:"broker_password" required:"true"`
BrokerUsername string `envconfig:"broker_username" required:"true"`
Bucket string `envconfig:"bucket" required:"true"`
CfApiAddress string `envconfig:"cf_api_address" required:"true"`
DatabaseUrl string `envconfig:"database_url" required:"true"`
Email string `envconfig:"email" required:"true"`
IamPathPrefix string `envconfig:"iam_path_prefix" default:"/domains-broker-v2/"`
MaxRoutes int `envconfig:"max_routes" default:"24"`
Port string `envconfig:"port" default:"3000"`
RenewDays int `envconfig:"renew_days" default:"30"`
Resolvers Resolver `envconfig:"resolvers" default:"cloudflare:1.1.1.1"`
Schedule string `envconfig:"schedule" default:"0 0 * * * *"`
ServerSideEncryption string `envconfig:"server_side_encryption"`
/*
Sets the logging level of the program. The higher the number, the less this will log.
1 = log.Debug("Useful debugging information.")
2 = log.Info("Something noteworthy happened!")
3 = log.Error("Something failed but I'm not quitting.")
4 = log.Fatal("Bye.")
*/
LogLevel int `envconfig:"log_level" default:"1"`
}
// Domain is an instance of a domain.
type Domain struct {
Value string
}