(ctx context.Context, ids ...string)
| 70 | } |
| 71 | |
| 72 | func (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 | |
| 90 | func (s *imlClusterService) OnComplete() { |
| 91 | auto.RegisterService("cluster", s) |
nothing calls this directly
no outgoing calls
no test coverage detected