mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-29 21:27:05 +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
|
@ -33,6 +33,22 @@ type FunkwhaleApiBackend struct {
|
|||
|
||||
func (b *FunkwhaleApiBackend) Name() string { return "funkwhale" }
|
||||
|
||||
func (b *FunkwhaleApiBackend) Options() *[]models.BackendOption {
|
||||
return &[]models.BackendOption{{
|
||||
Name: "server-url",
|
||||
Label: "Server URL",
|
||||
Type: models.String,
|
||||
}, {
|
||||
Name: "username",
|
||||
Label: "User name",
|
||||
Type: models.String,
|
||||
}, {
|
||||
Name: "token",
|
||||
Label: "Access token",
|
||||
Type: models.Secret,
|
||||
}}
|
||||
}
|
||||
|
||||
func (b *FunkwhaleApiBackend) FromConfig(config *viper.Viper) models.Backend {
|
||||
b.client = NewClient(
|
||||
config.GetString("server-url"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue