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

Method GetLabels

service/cluster/cluster.go:72–88  ·  view source on GitHub ↗
(ctx context.Context, ids ...string)

Source from the content-addressed store, hash-verified

70}
71
72func (s *imlClusterService) GetLabels(ctx context.Context, ids ...string) map[string]string {
73 if len(ids) == 0 {
74 return nil
75 }
76 if len(ids) == 1 {
77 o, err := s.store.GetByUUID(ctx, ids[0])
78 if err != nil || o == nil {
79 return nil
80 }
81 return map[string]string{o.UUID: o.Name}
82 }
83 list, err := s.store.ListQuery(ctx, "uuid in (?)", []interface{}{ids}, "id")
84 if err != nil {
85 return nil
86 }
87 return utils.SliceToMapO(list, func(o *cluster.Cluster) (string, string) { return o.UUID, o.Name })
88}
89
90func (s *imlClusterService) OnComplete() {
91 auto.RegisterService("cluster", s)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected