bottin/config.go

100 lines
3.1 KiB
Go
Raw Normal View History

2024-06-06 01:40:56 -04:00
package main
const (
ViperAPIPort string = "api.port"
FlagAPIPort string = "api-port"
DefaultAPIPort int = 1312
DescriptionAPIPort string = "API server port"
ViperAPIKey string = "api.key"
FlagAPIKey string = "api-key"
DefaultAPIKey string = "bottin"
DescriptionAPIKey string = "API server key. Leave empty for no key auth (not recommended)"
ViperDBDatabase string = "db.database"
FlagDBDatabase string = "db-database"
DefaultDBDatabase string = "bottin"
DescriptionDBDatabase string = "Postgres database"
ViperDBHost string = "db.host"
FlagDBHost string = "db-host"
DefaultDBHost string = "db"
DescriptionDBHost string = "Postgres host"
ViperDBPassword string = "db.password"
FlagDBPassword string = "db-password"
DefaultDBPassword string = "bottin"
DescriptionDBPassword string = "Postgres password"
ViperDBPort string = "db.port"
FlagDBPort string = "db-port"
DefaultDBPort int = 5432
DescriptionDBPort string = "Postgres port"
ViperDBUser string = "db.user"
FlagDBUser string = "db-user"
DefaultDBUser string = "bottin"
DescriptionDBUser string = "Postgres user"
viperWebUser string = "web.user"
flagWebUser string = "web-user"
defaultWebUser string = "bottin"
descriptionWebUser string = "Web client basic auth user"
viperWebPassword string = "web.password"
flagWebPassword string = "web-password"
defaultWebPassword string = "bottin"
descriptionWebPassword string = "Web client basic auth password"
viperWebPort string = "web.port"
flagWebPort string = "web-port"
defaultWebPort int = 2312
descriptionWebPort string = "Web client port"
viperWebAPIHost string = "api.host"
flagWebAPIHost string = "api-host"
defaultWebAPIHost string = "api"
descriptionWebAPIHost string = "Target API server host"
viperWebAPIKey string = "api.key"
flagWebAPIKey string = "api-key"
defaultWebAPIKey string = "bottin"
descriptionWebAPIKey string = "Target API server key"
viperWebAPIPort string = "api.port"
flagWebAPIPort string = "api-port"
defaultWebAPIPort int = 1312
descriptionWebAPIPort string = "Target API server port"
viperWebAPIProtocol string = "api.protocol"
flagWebAPIProtocol string = "api-protocol"
defaultWebAPIProtocol string = "http"
descriptionWebAPIProtocol string = "Target API server protocol (http/https)"
)
type Config struct {
API struct {
Port int `yaml:"port"`
Key string `yaml:"key"`
} `yaml:"api"`
DB struct {
Database string `yaml:"database"`
Host string `yaml:"host"`
SSLMode string `yaml:"sslmode"`
Password string `yaml:"password"`
Port int `yaml:"port"`
User string `yaml:"user"`
} `yaml:"db"`
Web struct {
User string `yaml:"user"`
Password string `yaml:"password"`
Port int `yaml:"port"`
API struct {
Host string `yaml:"host"`
Key string `yaml:"key"`
Port int `yaml:"port"`
Protocol string `yaml:"protocol"`
} `yaml:"api"`
} `yaml:"web"`
}