teldrive/internal/config/config.go

67 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
ReadTimeout time.Duration
WriteTimeout time.Duration
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
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
Encoding string
Development bool
}
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 {
MaxOpen int
MaxIdle int
MaxLifetime time.Duration
}
}