the most rudimentary of limits (#96)

This commit is contained in:
Michael Quigley 2023-01-13 09:42:42 -05:00
parent 2da67d4a29
commit 0aa0eea0c7
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -14,12 +14,13 @@ type Config struct {
Admin *AdminConfig Admin *AdminConfig
Endpoint *EndpointConfig Endpoint *EndpointConfig
Email *EmailConfig Email *EmailConfig
Influx *InfluxConfig
Limits *LimitsConfig
Maintenance *MaintenanceConfig
Metrics *MetricsConfig
Registration *RegistrationConfig Registration *RegistrationConfig
Store *store.Config Store *store.Config
Ziti *ZitiConfig Ziti *ZitiConfig
Metrics *MetricsConfig
Influx *InfluxConfig
Maintenance *MaintenanceConfig
} }
type AdminConfig struct { type AdminConfig struct {
@ -71,9 +72,22 @@ type RegistrationMaintenanceConfig struct {
BatchLimit int BatchLimit int
} }
const Unlimited = -1
type LimitsConfig struct {
Environments int
Shares int
}
func DefaultConfig() *Config { func DefaultConfig() *Config {
return &Config{ return &Config{
Metrics: &MetricsConfig{ServiceName: "metrics"}, Limits: &LimitsConfig{
Environments: Unlimited,
Shares: Unlimited,
},
Metrics: &MetricsConfig{
ServiceName: "metrics",
},
Maintenance: &MaintenanceConfig{ Maintenance: &MaintenanceConfig{
Registration: &RegistrationMaintenanceConfig{ Registration: &RegistrationMaintenanceConfig{
ExpirationTimeout: time.Hour * 24, ExpirationTimeout: time.Hour * 24,