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

Function TargetOf

service/permit-type/driver.go:26–48  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

24 return vs
25}
26func TargetOf(key string) *Target {
27 index := strings.Index(key, ":")
28 if index > 0 {
29
30 tp := Parse(key[0:index])
31 if tp != Invalid {
32 name := key[index+1:]
33
34 if tp == Special {
35 if v, has := specialRoles[name]; has {
36 return v
37 }
38 }
39 return tp.Target(name, "unknown")
40 }
41 }
42 return &Target{
43 Type: Invalid,
44 Name: key,
45 Label: key,
46 }
47
48}
49
50func CompleteLabels(ctx context.Context, vs ...*Target) {
51 ml := turn(vs)

Callers 1

TargetsOfFunction · 0.85

Calls 2

ParseFunction · 0.85
TargetMethod · 0.65

Tested by

no test coverage detected