MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / SimpleList

Method SimpleList

module/router/iml.go:111–128  ·  view source on GitHub ↗
(ctx context.Context, serviceId string)

Source from the content-addressed store, hash-verified

109}
110
111func (i *imlRouterModule) SimpleList(ctx context.Context, serviceId string) ([]*router_dto.SimpleItem, error) {
112
113 list, err := i.apiService.ListForService(ctx, serviceId)
114 apiInfos, err := i.apiService.ListInfo(ctx, utils.SliceToSlice(list, func(s *api.API) string {
115 return s.UUID
116 })...)
117 if err != nil {
118 return nil, err
119 }
120
121 out := utils.SliceToSlice(apiInfos, func(item *api.Info) *router_dto.SimpleItem {
122 return &router_dto.SimpleItem{
123 Id: item.UUID,
124 Path: item.Path,
125 }
126 })
127 return out, nil
128}
129
130func (i *imlRouterModule) Detail(ctx context.Context, serviceId string, apiId string) (*router_dto.Detail, error) {
131 _, err := i.serviceService.Check(ctx, serviceId, asServer)

Callers

nothing calls this directly

Calls 2

ListForServiceMethod · 0.65
ListInfoMethod · 0.65

Tested by

no test coverage detected