This commit is contained in:
2025-01-16 00:17:11 +01:00
committed by Kevin Midboe
commit b4f3ec3343
13 changed files with 621 additions and 0 deletions

18
converter/json.go Normal file
View File

@@ -0,0 +1,18 @@
package converter
import (
"encoding/json"
"log"
"github.com/traefik/traefik/v3/pkg/config/dynamic"
)
func TraefikToJSON(config *dynamic.Configuration) map[string]interface{} {
var data map[string]interface{}
jsonData, _ := json.Marshal(config)
if err := json.Unmarshal(jsonData, &data); err != nil {
log.Printf("failed to unmarshal JSON: %w", err)
}
return data
}