-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
34 lines (26 loc) · 1.43 KB
/
config.go
File metadata and controls
34 lines (26 loc) · 1.43 KB
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
package ctrlplane
import "time"
// Config holds global configuration for the CtrlPlane.
type Config struct {
// DatabaseURL is the database connection string.
DatabaseURL string `json:"database_url" mapstructure:"database_url" yaml:"database_url"`
// DefaultProvider is the provider name used when none is specified.
DefaultProvider string `json:"default_provider" mapstructure:"default_provider" yaml:"default_provider"`
// HealthInterval is the default health check interval for all instances.
HealthInterval time.Duration `json:"health_interval" mapstructure:"health_interval" yaml:"health_interval"`
// TelemetryFlushInterval is how often telemetry data is flushed.
TelemetryFlushInterval time.Duration `json:"telemetry_flush_interval" mapstructure:"telemetry_flush_interval" yaml:"telemetry_flush_interval"`
// MaxInstancesPerTenant is the default quota for instances per tenant.
// A value of 0 means unlimited.
MaxInstancesPerTenant int `json:"max_instances_per_tenant" mapstructure:"max_instances_per_tenant" yaml:"max_instances_per_tenant"`
// AuditEnabled controls whether audit logging is active.
AuditEnabled bool `json:"audit_enabled" mapstructure:"audit_enabled" yaml:"audit_enabled"`
}
// DefaultCtrlPlaneConfig returns a Config with sensible defaults.
func DefaultCtrlPlaneConfig() Config {
return Config{
HealthInterval: 30 * time.Second,
TelemetryFlushInterval: 10 * time.Second,
AuditEnabled: true,
}
}