mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WIP Transmission
This commit is contained in:
parent
a4a3d4e531
commit
ae13a3394d
@ -29,7 +29,6 @@ type Settings struct {
|
||||
|
||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||
|
||||
|
38
modules/transmission/settings.go
Normal file
38
modules/transmission/settings.go
Normal file
@ -0,0 +1,38 @@
|
||||
package transmission
|
||||
|
||||
import (
|
||||
"github.com/olebedev/config"
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
)
|
||||
|
||||
// Settings defines the configuration properties for this module
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
|
||||
host string
|
||||
https bool
|
||||
password string
|
||||
port int
|
||||
url string
|
||||
username string
|
||||
}
|
||||
|
||||
const (
|
||||
defaultTitle = "Transmission"
|
||||
)
|
||||
|
||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||
|
||||
host: ymlConfig.UString("host"),
|
||||
https: ymlConfig.UBool("https", false),
|
||||
password: ymlConfig.UString("password"),
|
||||
port: ymlConfig.UInt("port", 9091),
|
||||
url: ymlConfig.UString("url", "/transmission/"),
|
||||
username: ymlConfig.UString("username", ""),
|
||||
}
|
||||
|
||||
return &settings
|
||||
}
|
1
modules/transmission/widget.go
Normal file
1
modules/transmission/widget.go
Normal file
@ -0,0 +1 @@
|
||||
package transmission
|
Loading…
x
Reference in New Issue
Block a user