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

Method GetLabels

service/release/iml.go:153–171  ·  view source on GitHub ↗
(ctx context.Context, ids ...string)

Source from the content-addressed store, hash-verified

151}
152
153func (s *imlReleaseService) GetLabels(ctx context.Context, ids ...string) map[string]string {
154 if len(ids) == 0 {
155 return nil
156 }
157 if len(ids) == 1 {
158 o, err := s.releaseStore.GetByUUID(ctx, ids[0])
159 if err != nil || o == nil {
160 return nil
161 }
162 return map[string]string{
163 o.UUID: o.Name,
164 }
165 }
166 list, err := s.releaseStore.ListQuery(ctx, "`uuid` in ?", []interface{}{ids}, "id")
167 if err != nil {
168 return nil
169 }
170 return utils.SliceToMapO(list, func(o *release.Release) (string, string) { return o.UUID, o.Name })
171}
172
173func (s *imlReleaseService) GetApiProxyCommit(ctx context.Context, id string, apiUUID string) (string, error) {
174 commits, err := s.getCommitByType(ctx, id, CommitApiProxy, apiUUID)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected