2024-07-31 16:01:18 +00:00
|
|
|
package config
|
|
|
|
|
2024-10-18 15:22:01 +00:00
|
|
|
type EventTimeConstraints struct {
|
|
|
|
MinCreatedAt int64 `yaml:"min_created_at"` // Minimum allowed timestamp
|
2024-10-18 15:33:23 +00:00
|
|
|
MinCreatedAtString string `yaml:"min_created_at_string"` // Original string value for parsing (e.g., "now-5m")
|
2024-10-18 15:22:01 +00:00
|
|
|
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")
|
|
|
|
}
|
|
|
|
|
2024-07-31 16:01:18 +00:00
|
|
|
type ServerConfig struct {
|
|
|
|
MongoDB struct {
|
|
|
|
URI string `yaml:"uri"`
|
|
|
|
Database string `yaml:"database"`
|
|
|
|
} `yaml:"mongodb"`
|
|
|
|
Server struct {
|
2024-08-09 12:38:18 +00:00
|
|
|
Port string `yaml:"port"`
|
2024-10-18 15:22:01 +00:00
|
|
|
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"`
|
2024-07-31 16:01:18 +00:00
|
|
|
} `yaml:"server"`
|
2024-10-18 15:22:01 +00:00
|
|
|
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
|
2024-10-30 16:29:50 +00:00
|
|
|
Blossom struct {
|
|
|
|
BlossomPath string `yaml:"blossom_path"` // Path to store blossom files
|
|
|
|
MaxFileSize int `yaml:"max_file_size"` // Optional: Max file size for uploads
|
|
|
|
} `yaml:"blossom"`
|
2024-08-03 18:27:58 +00:00
|
|
|
}
|