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

Method List

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

Source from the content-addressed store, hash-verified

21}
22
23func (i *imlUpstreamService) List(ctx context.Context, serviceIds ...string) ([]*Upstream, error) {
24 w := make(map[string]interface{})
25 if len(serviceIds) > 0 {
26 w["service"] = serviceIds
27 }
28
29 upstreams, err := i.store.List(ctx, w)
30 if err != nil {
31 return nil, err
32 }
33 return utils.SliceToSlice(upstreams, func(u *upstream.Upstream) *Upstream {
34 return &Upstream{
35 Item: &Item{
36 UUID: u.UUID,
37 Service: u.Service,
38 Team: u.Team,
39 Remark: u.Remark,
40 Creator: u.Creator,
41 Updater: u.Updater,
42 CreateTime: u.CreateAt,
43 UpdateTime: u.UpdateAt,
44 },
45 }
46 }), nil
47}
48
49func (i *imlUpstreamService) ListCommit(ctx context.Context, uuid ...string) ([]*commit.Commit[Config], error) {
50 return i.commitService.List(ctx, uuid...)

Callers

nothing calls this directly

Calls 1

ListMethod · 0.65

Tested by

no test coverage detected