arimelody-web/model/app/appstate.go

62 lines
1.7 KiB
Go
Raw Normal View History

package app
2025-02-07 16:40:58 +00:00
import (
2025-09-30 19:03:35 +01:00
"embed"
2025-02-07 16:40:58 +00:00
2025-09-30 19:03:35 +01:00
"github.com/jmoiron/sqlx"
"arimelody-web/model/twitch"
2026-07-31 10:02:34 +01:00
logService "arimelody-web/service/log"
//inviteService "arimelody-web/service/invite"
accountService "arimelody-web/service/account"
//sessionService "arimelody-web/service/session"
musicService "arimelody-web/service/music"
2025-02-07 16:40:58 +00:00
)
type (
DBConfig struct {
Host string `toml:"host"`
Port int64 `toml:"port"`
Name string `toml:"name"`
User string `toml:"user"`
Pass string `toml:"pass"`
}
DiscordConfig struct {
AdminID string `toml:"admin_id" comment:"NOTE: admin_id to be deprecated in favour of local accounts and SSO."`
ClientID string `toml:"client_id"`
Secret string `toml:"secret"`
}
TwitchConfig struct {
Broadcaster string `toml:"broadcaster"`
ClientID string `toml:"client_id"`
Secret string `toml:"secret"`
}
Config struct {
BaseUrl string `toml:"base_url" comment:"Used for OAuth redirects."`
2025-01-21 17:13:06 +00:00
Host string `toml:"host"`
Port int64 `toml:"port"`
DataDirectory string `toml:"data_dir"`
2025-02-07 16:54:36 +00:00
TrustedProxies []string `toml:"trusted_proxies"`
DB DBConfig `toml:"db"`
2025-06-17 02:01:06 +01:00
Discord *DiscordConfig `toml:"discord"`
Twitch *TwitchConfig `toml:"twitch"`
}
AppState struct {
DB *sqlx.DB
Config Config
Twitch *twitch.State
2025-09-30 19:03:35 +01:00
PublicFS embed.FS
2026-07-31 10:02:34 +01:00
LogService *logService.LogService
//InviteService *inviteService.InviteService
AccountService *accountService.AccountService
//SesisonService *sessionService.SessionService
MusicService *musicService.MusicService
}
)