Documentation
¶
Index ¶
- type AuthConfig
- type BlacklistConfig
- type CategoryLimitConfig
- type ClientConfig
- type EventPurgeConfig
- type EventTimeConstraints
- type KindLimitConfig
- type KindSizeLimitConfig
- type LimitBurst
- type LogConfig
- type RateLimitConfig
- type ResourceLimits
- type ServerConfig
- type UserSyncConfig
- type WhitelistConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type BlacklistConfig ¶
type BlacklistConfig struct {
Enabled bool `yaml:"enabled"`
PermanentBanWords []string `yaml:"permanent_ban_words"`
TempBanWords []string `yaml:"temp_ban_words"`
MaxTempBans int `yaml:"max_temp_bans"`
TempBanDuration int `yaml:"temp_ban_duration"`
PermanentBlacklistPubkeys []string `yaml:"permanent_blacklist_pubkeys"`
PermanentBlacklistNpubs []string `yaml:"permanent_blacklist_npubs"`
MuteListAuthors []string `yaml:"mutelist_authors"`
MutelistCacheRefreshMinutes int `yaml:"mutelist_cache_refresh_minutes"`
}
type CategoryLimitConfig ¶
type CategoryLimitConfig struct {
Regular LimitBurst `yaml:"regular"`
Replaceable LimitBurst `yaml:"replaceable"`
Addressable LimitBurst `yaml:"addressable"`
Ephemeral LimitBurst `yaml:"ephemeral"`
}
type ClientConfig ¶ added in v0.4.11
type ClientConfig struct {
DefaultRelays []string `yaml:"default_relays"`
ConnectionTimeout int `yaml:"connection_timeout"` // seconds
ReadTimeout int `yaml:"read_timeout"` // seconds
WriteTimeout int `yaml:"write_timeout"` // seconds
MaxConnections int `yaml:"max_connections"`
RetryAttempts int `yaml:"retry_attempts"`
RetryDelay int `yaml:"retry_delay"` // seconds
KeepAlive bool `yaml:"keep_alive"`
UserAgent string `yaml:"user_agent"`
}
type EventPurgeConfig ¶
type EventPurgeConfig struct {
Enabled bool `yaml:"enabled"`
DisableAtStartup bool `yaml:"disable_at_startup"`
KeepIntervalHours int `yaml:"keep_interval_hours"`
PurgeIntervalMinutes int `yaml:"purge_interval_minutes"`
PurgeByCategory map[string]bool `yaml:"purge_by_category"`
PurgeByKindEnabled bool `yaml:"purge_by_kind_enabled"`
KindsToPurge []int `yaml:"kinds_to_purge"`
ExcludeWhitelisted bool `yaml:"exclude_whitelisted"`
}
type EventTimeConstraints ¶
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 KindLimitConfig ¶
type KindSizeLimitConfig ¶
type LimitBurst ¶
type LogConfig ¶
type LogConfig struct {
Level string `yaml:"level"`
File string `yaml:"file"`
MaxSizeMB int `yaml:"max_log_size_mb"`
Structure bool `yaml:"structure"`
CheckIntervalMin int `yaml:"check_interval_min"` // How often the program checks the size of the current log file
BackupCount int `yaml:"backup_count"` // Number of backup logs to keep
SuppressComponents []string `yaml:"suppress_components"` // Components to suppress INFO/DEBUG logs from
}
type RateLimitConfig ¶
type RateLimitConfig struct {
WsLimit float64 `yaml:"ws_limit"`
WsBurst int `yaml:"ws_burst"`
EventLimit float64 `yaml:"event_limit"`
EventBurst int `yaml:"event_burst"`
ReqLimit float64 `yaml:"req_limit"`
ReqBurst int `yaml:"req_burst"`
MaxEventSize int `yaml:"max_event_size"`
KindSizeLimits []KindSizeLimitConfig `yaml:"kind_size_limits"`
CategoryLimits map[string]KindLimitConfig `yaml:"category_limits"`
KindLimits []KindLimitConfig `yaml:"kind_limits"`
}
type ResourceLimits ¶
type ServerConfig ¶
type ServerConfig struct {
Logging LogConfig `yaml:"logging"`
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"`
MaxSubscriptionsPerClient int `yaml:"max_subscriptions_per_client"`
ImplicitReqLimit int `yaml:"implicit_req_limit"` // New field for implicit REQ limit
} `yaml:"server"`
Client ClientConfig `yaml:"client"`
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"`
UserSync UserSyncConfig `yaml:"UserSync"`
}
type UserSyncConfig ¶
type UserSyncConfig struct {
UserSync bool `yaml:"user_sync"` // Enable/disable syncing
DisableAtStartup bool `yaml:"disable_at_startup"` // New field
InitialSyncRelays []string `yaml:"initial_sync_relays"` // Relays for initial kind10002 fetch
Kinds []int `yaml:"kinds"` // Kinds to sync
Categories string `yaml:"categories"` // Categories to sync
Limit *int `yaml:"limit"` // Limit per kind
ExcludeNonWhitelisted bool `yaml:"exclude_non_whitelisted"` // Sync only whitelisted users
Interval int `yaml:"interval"` // Resync interval in hours
}
type WhitelistConfig ¶
type WhitelistConfig struct {
PubkeyWhitelist struct {
Enabled bool `yaml:"enabled"`
Pubkeys []string `yaml:"pubkeys"`
Npubs []string `yaml:"npubs"`
CacheRefreshMinutes int `yaml:"cache_refresh_minutes"`
} `yaml:"pubkey_whitelist"`
KindWhitelist struct {
Enabled bool `yaml:"enabled"`
Kinds []string `yaml:"kinds"`
} `yaml:"kind_whitelist"`
DomainWhitelist struct {
Enabled bool `yaml:"enabled"`
Domains []string `yaml:"domains"`
CacheRefreshMinutes int `yaml:"cache_refresh_minutes"`
} `yaml:"domain_whitelist"`
}
Click to show internal directories.
Click to hide internal directories.