chore: minor

This commit is contained in:
andig 2026-04-01 19:32:08 +02:00
parent 24327e834e
commit 388a1480b0
2 changed files with 7 additions and 12 deletions

View file

@ -6,9 +6,16 @@ import (
"strings"
"github.com/evcc-io/evcc/util"
reg "github.com/evcc-io/evcc/util/registry"
"golang.org/x/oauth2"
)
var registry = reg.New[oauth2.TokenSource]("auth")
func Register(typ string, fun func(map[string]any) (oauth2.TokenSource, error)) {
registry.Add(typ, fun)
}
// NewFromConfig creates auth from configuration
func NewFromConfig(ctx context.Context, typ string, other map[string]any) (oauth2.TokenSource, error) {
factory, err := registry.Get(strings.ToLower(typ))

View file

@ -1,12 +0,0 @@
package auth
import (
reg "github.com/evcc-io/evcc/util/registry"
"golang.org/x/oauth2"
)
var registry = reg.New[oauth2.TokenSource]("auth")
func Register(typ string, fun func(map[string]any) (oauth2.TokenSource, error)) {
registry.Add(typ, fun)
}