From 0aa0eea0c7e4f2d0fb27d4185f7d23aefa780890 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 13 Jan 2023 09:42:42 -0500 Subject: [PATCH] the most rudimentary of limits (#96) --- controller/config.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/controller/config.go b/controller/config.go index a879c28f..3a04077d 100644 --- a/controller/config.go +++ b/controller/config.go @@ -14,12 +14,13 @@ type Config struct { Admin *AdminConfig Endpoint *EndpointConfig Email *EmailConfig + Influx *InfluxConfig + Limits *LimitsConfig + Maintenance *MaintenanceConfig + Metrics *MetricsConfig Registration *RegistrationConfig Store *store.Config Ziti *ZitiConfig - Metrics *MetricsConfig - Influx *InfluxConfig - Maintenance *MaintenanceConfig } type AdminConfig struct { @@ -71,9 +72,22 @@ type RegistrationMaintenanceConfig struct { BatchLimit int } +const Unlimited = -1 + +type LimitsConfig struct { + Environments int + Shares int +} + func DefaultConfig() *Config { return &Config{ - Metrics: &MetricsConfig{ServiceName: "metrics"}, + Limits: &LimitsConfig{ + Environments: Unlimited, + Shares: Unlimited, + }, + Metrics: &MetricsConfig{ + ServiceName: "metrics", + }, Maintenance: &MaintenanceConfig{ Registration: &RegistrationMaintenanceConfig{ ExpirationTimeout: time.Hour * 24,