mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-19 06:32:30 +00:00
18 lines
321 B
Go
18 lines
321 B
Go
package decoders
|
|
|
|
import (
|
|
"github.com/traefik/paerser/parser"
|
|
)
|
|
|
|
func DecodeLabels[T any](labels map[string]string, root string) (T, error) {
|
|
var labelsDecoded T
|
|
|
|
err := parser.Decode(labels, &labelsDecoded, "tinyauth", "tinyauth."+root)
|
|
|
|
if err != nil {
|
|
return labelsDecoded, err
|
|
}
|
|
|
|
return labelsDecoded, nil
|
|
}
|