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

Method ListLatestCommit

service/upstream/iml.go:53–72  ·  view source on GitHub ↗
(ctx context.Context, clusterId string, serviceIds ...string)

Source from the content-addressed store, hash-verified

51}
52
53func (i *imlUpstreamService) ListLatestCommit(ctx context.Context, clusterId string, serviceIds ...string) ([]*commit.Commit[Config], error) {
54 w := make(map[string]interface{})
55 if len(serviceIds) > 0 {
56 w["service"] = serviceIds
57 }
58
59 upstreams, err := i.store.List(ctx, w)
60 if err != nil {
61 return nil, err
62 }
63 if len(upstreams) == 0 {
64 return nil, nil
65 //return nil, errors.New("upstream not found")
66 }
67 targetId := utils.SliceToSlice(upstreams, func(u *upstream.Upstream) string {
68 return u.UUID
69 })
70 return i.commitService.ListLatest(ctx, clusterId, targetId...)
71
72}
73
74func (i *imlUpstreamService) GetCommit(ctx context.Context, uuid string) (*commit.Commit[Config], error) {
75 return i.commitService.Get(ctx, uuid)

Callers

nothing calls this directly

Calls 2

ListMethod · 0.65
ListLatestMethod · 0.65

Tested by

no test coverage detected