MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / Version

Method Version

gateway/apinto/dynamic.go:34–48  ·  view source on GitHub ↗
(ctx context.Context, resourceId string)

Source from the content-addressed store, hash-verified

32}
33
34func (d *DynamicClient) Version(ctx context.Context, resourceId string) (string, error) {
35 worker, err := d.client.Get(ctx, genWorkerID(resourceId, d.profession))
36 if err != nil {
37 return "", err
38 }
39 if len(worker) == 0 {
40 return "", nil
41 }
42 var item entity.BasicInfo
43 err = worker.Scan(encoding.Json[entity.BasicInfo](&item))
44 if err != nil {
45 return "", err
46 }
47 return item.Version, nil
48}
49
50func (d *DynamicClient) Versions(ctx context.Context, matchLabels map[string]string) (map[string]string, error) {
51 workers, err := d.client.MatchLabels(ctx, d.profession, matchLabels)

Callers

nothing calls this directly

Calls 3

genWorkerIDFunction · 0.85
GetMethod · 0.65
ScanMethod · 0.45

Tested by

no test coverage detected