mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-11-24 17:33:22 +00:00
34 lines
1.5 KiB
Go
34 lines
1.5 KiB
Go
package config
|
|
|
|
type EventTimeConstraints struct {
|
|
MinCreatedAt int64 `yaml:"min_created_at"` // Minimum allowed timestamp
|
|
MinCreatedAtString string `yaml:"min_created_at_string"` // Original string value for parsing (e.g., "now-5m")
|
|
MaxCreatedAt int64 `yaml:"max_created_at"` // Maximum allowed timestamp
|
|
MaxCreatedAtString string `yaml:"max_created_at_string"` // Original string value for parsing (e.g., "now+5m")
|
|
}
|
|
|
|
type ServerConfig struct {
|
|
MongoDB struct {
|
|
URI string `yaml:"uri"`
|
|
Database string `yaml:"database"`
|
|
} `yaml:"mongodb"`
|
|
Server struct {
|
|
Port string `yaml:"port"`
|
|
ReadTimeout int `yaml:"read_timeout"`
|
|
WriteTimeout int `yaml:"write_timeout"`
|
|
IdleTimeout int `yaml:"idle_timeout"`
|
|
MaxConnections int `yaml:"max_connections"`
|
|
MaxSubscriptionsPerClient int `yaml:"max_subscriptions_per_client"`
|
|
} `yaml:"server"`
|
|
RateLimit RateLimitConfig `yaml:"rate_limit"`
|
|
Blacklist BlacklistConfig `yaml:"blacklist"`
|
|
ResourceLimits ResourceLimits `yaml:"resource_limits"`
|
|
Auth AuthConfig `yaml:"auth"`
|
|
EventPurge EventPurgeConfig `yaml:"event_purge"`
|
|
EventTimeConstraints EventTimeConstraints `yaml:"event_time_constraints"` // Added this field
|
|
BackupRelay struct {
|
|
Enabled bool `yaml:"enabled"`
|
|
URL string `yaml:"url"`
|
|
} `yaml:"backup_relay"`
|
|
}
|