MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / CompleteLabels

Function CompleteLabels

service/permit-type/driver.go:50–68  ·  view source on GitHub ↗
(ctx context.Context, vs ...*Target)

Source from the content-addressed store, hash-verified

48}
49
50func CompleteLabels(ctx context.Context, vs ...*Target) {
51 ml := turn(vs)
52 for n, vm := range ml {
53 if n == Special {
54 continue
55 } else if service, has := auto.GetService(n.Name()); has {
56 nl := utils.MapKeys(vm)
57 labels := service.GetLabels(ctx, nl...)
58 if labels == nil {
59 continue
60 }
61 for _, v := range vs {
62 if lv, h := labels[v.Name]; h {
63 v.Label = lv
64 }
65 }
66 }
67 }
68}
69
70func turn(vs []*Target) map[PermitType]map[string]*Target {
71 rs := make(map[PermitType]map[string]*Target)

Callers

nothing calls this directly

Calls 3

turnFunction · 0.85
NameMethod · 0.65
GetLabelsMethod · 0.45

Tested by

no test coverage detected