Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide( NewConfig, func(cfg Config) (telegram.BotToken, telegram.TelegramAdmins) { return cfg.Telegram.Token, cfg.Telegram.Admins }, func(cfg Config) (rutracker.Username, rutracker.Password) { return cfg.Rutracker.Login, cfg.Rutracker.Password }, func(cfg Config) torrentsinfra.DownloadTorrentsDir { return cfg.App.DownloadTorrentsTo }, func(cfg Config) application.ViewTorrentInUILink { return application.ViewTorrentInUILink(cfg.Transmission.WebUiLink) }, func(cfg Config) (torrentsinfra.PollStatusDuration, torrentsinfra.PollStatusTimeout) { duration := torrentsinfra.PollStatusDuration(time.Second * time.Duration(cfg.App.PollTorrentStatusDurationSeconds)) timeout := torrentsinfra.PollStatusTimeout(time.Second * time.Duration(cfg.App.PollTorrentStatusTimeoutSeconds)) return duration, timeout }, func(cfg Config) (transmission.Host, transmission.User, transmission.Password) { host := transmission.Host(cfg.Transmission.RPCHost) user := transmission.User(cfg.Transmission.RPCUser) password := transmission.Password(cfg.Transmission.RPCPassword) return host, user, password }, ), )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Telegram struct { Token telegram.BotToken `env:"TELEGRAM_BOT_TOKEN" env-required:"true"` Admins telegram.TelegramAdmins `env:"TELEGRAM_BOT_ADMINS" env-required:"true"` } Rutracker struct { Login rutracker.Username `env:"RUTRACKER_LOGIN" env-required:"true"` Password rutracker.Password `env:"RUTRACKER_PASSWORD" env-required:"true"` } Transmission struct { RPCHost string `env:"TRANSMISSION_RPC_HOST" env-default:"localhost"` RPCUser string `env:"TRANSMISSION_RPC_USER" env-default:"admin"` RPCPassword string `env:"TRANSMISSION_RPC_PASSWORD" env-required:"true"` WebUiLink string `env:"TRANSMISSION_WEB_UI_LINK" env-default:"http://localhost:9091/transmission/web"` } App struct { DownloadTorrentsTo torrentsinfra.DownloadTorrentsDir `env:"DOWNLOAD_DIR" env-required:"true"` PollTorrentStatusTimeoutSeconds int `env:"POLL_TORRENT_STATUS_TIMEOUT_SECONDS" env-default:"3600"` PollTorrentStatusDurationSeconds int `env:"POLL_TORRENT_STATUS_DURATION_SECONDS" env-default:"5"` } }
Click to show internal directories.
Click to hide internal directories.