-
Notifications
You must be signed in to change notification settings - Fork 6
/
parser_example_test.go
29 lines (23 loc) · 1.02 KB
/
parser_example_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package audit
import (
"fmt"
"github.com/luraproject/lura/v2/config"
)
func ExampleParse() {
cfg, err := config.NewParser().Parse("./tests/example1.json")
if err != nil {
fmt.Println(err.Error())
return
}
cfg.Normalize()
result := Parse(&cfg)
fmt.Println("details:", result.Details)
fmt.Println("agents:", result.Agents)
fmt.Println("endpoints:", result.Endpoints)
fmt.Println("components:", result.Components)
// output:
// details: [7220]
// agents: []
// endpoints: [{[2 0 0 140000 0 0] [{[64] map[]}] map[github.com/devopsfaith/krakend-jose/validator:[]]} {[2 1 1 10000 7 0] [{[64] map[backend/http/client:[3]]}] map[github.com/devopsfaith/krakend/transport/http/client/executor:[1]]} {[2 0 0 10000 8 2] [{[64] map[]} {[64] map[]} {[64] map[]}] map[github.com/devopsfaith/krakend/proxy:[1]]}]
// components: map[auth/api-keys:[] github_com/devopsfaith/krakend/transport/http/server/handler:[4] github_com/luraproject/lura/router/gin:[262144] grpc:[1] qos/ratelimit/service:[] telemetry/opentelemetry:[50 100 1 2 1]]
}