revork structures for hub

This commit is contained in:
2026-04-25 16:04:53 +02:00
parent 635139aad2
commit df1e969d49
9 changed files with 165 additions and 157 deletions
+11 -9
View File
@@ -12,28 +12,30 @@ import (
var (
Port uint32 = 8080
MaxDirectMsgCache uint32 = 32
MaxHubMsgCache uint32 = 32
MaxHubChannelMsgCache uint32 = 16
MaxUserHubRoles uint8 = 64
FileStorageBucketName string = "communicator"
MaxRequestBytes uint32 = 4 << 10
MaxRequestWithFileBytes uint32 = 1 << 30
MaxRequestWithAvatarBytes uint = 1 << 20
MaxRequestWithProfileBgBytes uint = 4 << 20
MaxRequestWithAvatarBytes uint32 = 1 << 20
MaxRequestWithProfileBgBytes uint32 = 4 << 20
FileProcessingPartBytes uint64 = 12 << 20
FileProcessingThreads uint = 3
FileProcessingThreads uint32 = 3
FileDownloadLinkTtl time.Duration = 24 * time.Hour
)
type configFile struct {
Port uint32 `toml:"port"`
MaxDirectMsgCache uint32 `toml:"max_direct_messages_cache"`
MaxHubMsgCache uint32 `toml:"max_hub_msg_cache"`
MaxHubChannelMsgCache uint32 `toml:"max_hub_channel_msg_cache"`
MaxUserHubRoles uint8 `toml:"max_hub_roles"`
FileStorageBucketName string `toml:"file_storage_bucket_name"`
MaxRequestBytes uint32 `toml:"max_request_bytes"`
MaxRequestWithFileBytes uint32 `toml:"max_request_with_file_bytes"`
MaxRequestWithAvatarBytes uint `toml:"max_request_with_avatar_bytes"`
MaxRequestWithProfileBgBytes uint `toml:"max_request_with_profile_bg_bytes"`
MaxRequestWithAvatarBytes uint32 `toml:"max_request_with_avatar_bytes"`
MaxRequestWithProfileBgBytes uint32 `toml:"max_request_with_profile_bg_bytes"`
FileProcessingPartBytes uint64 `toml:"file_processing_part_bytes"`
FileProcessingThreads uint `toml:"file_processing_threads"`
FileProcessingThreads uint32 `toml:"file_processing_threads"`
FileDownloadLinkTtl time.Duration `toml:"file_download_link_ttl"`
}
@@ -51,7 +53,7 @@ func LoadConfFile() {
Port = cfg.Port
MaxDirectMsgCache = cfg.MaxDirectMsgCache
MaxHubMsgCache = cfg.MaxHubMsgCache
MaxHubChannelMsgCache = cfg.MaxHubChannelMsgCache
FileStorageBucketName = cfg.FileStorageBucketName
MaxRequestBytes = cfg.MaxRequestBytes
MaxRequestWithFileBytes = cfg.MaxRequestWithFileBytes