teldrive/internal/config/config.go

66 lines
1.1 KiB
Go
Raw Normal View History

package config
import (
"time"
)
type Config struct {
2024-02-13 00:02:55 +08:00
Server ServerConfig
Log LoggingConfig
JWT JWTConfig
DB DBConfig
TG TGConfig
}
type ServerConfig struct {
2024-02-13 00:02:55 +08:00
Port int
GracefulShutdown time.Duration
}
2024-02-13 00:02:55 +08:00
type TGConfig struct {
AppId int
AppHash string
RateLimit bool
RateBurst int
Rate int
DeviceModel string
SystemVersion string
AppVersion string
LangCode string
SystemLangCode string
LangPack string
SessionFile string
2024-02-13 00:02:55 +08:00
BgBotsLimit int
DisableStreamBots bool
Uploads struct {
2024-02-13 00:02:55 +08:00
EncryptionKey string
Threads int
Retention time.Duration
}
}
type LoggingConfig struct {
2024-02-13 00:02:55 +08:00
Level int
Development bool
File string
}
type JWTConfig struct {
2024-02-13 00:02:55 +08:00
Secret string
SessionTime time.Duration
AllowedUsers []string
}
type DBConfig struct {
2024-02-13 00:02:55 +08:00
DataSource string
LogLevel int
Migrate struct {
Enable bool
}
2024-02-13 00:02:55 +08:00
Pool struct {
MaxOpenConnections int
MaxIdleConnections int
MaxLifetime time.Duration
}
}