mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-29 05:17:04 +02:00
Dynamic per-backend configuration options
This commit is contained in:
parent
ae5f1c5f26
commit
c9fa21be73
14 changed files with 262 additions and 17 deletions
|
@ -36,6 +36,18 @@ type DeezerApiBackend struct {
|
|||
|
||||
func (b *DeezerApiBackend) Name() string { return "deezer" }
|
||||
|
||||
func (b *DeezerApiBackend) Options() *[]models.BackendOption {
|
||||
return &[]models.BackendOption{{
|
||||
Name: "client-id",
|
||||
Label: "Client ID",
|
||||
Type: models.String,
|
||||
}, {
|
||||
Name: "client-secret",
|
||||
Label: "Client secret",
|
||||
Type: models.Secret,
|
||||
}}
|
||||
}
|
||||
|
||||
func (b *DeezerApiBackend) FromConfig(config *viper.Viper) models.Backend {
|
||||
b.clientId = config.GetString("client-id")
|
||||
b.clientSecret = config.GetString("client-secret")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue