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

Method SimpleAPIs

module/router/iml.go:49–69  ·  view source on GitHub ↗
(ctx context.Context, input *router_dto.InputSimpleAPI)

Source from the content-addressed store, hash-verified

47}
48
49func (i *imlRouterModule) SimpleAPIs(ctx context.Context, input *router_dto.InputSimpleAPI) ([]*router_dto.SimpleItem, error) {
50 list, err := i.apiService.ListForServices(ctx, input.Services...)
51 if err != nil {
52 return nil, err
53 }
54 apiInfos, err := i.apiService.ListInfo(ctx, utils.SliceToSlice(list, func(s *api.API) string {
55 return s.UUID
56 })...)
57 if err != nil {
58 return nil, err
59 }
60
61 return utils.SliceToSlice(apiInfos, func(item *api.Info) *router_dto.SimpleItem {
62 return &router_dto.SimpleItem{
63 Id: item.UUID,
64 Name: item.Name,
65 Methods: item.Methods,
66 Path: item.Path,
67 }
68 }), nil
69}
70
71func (i *imlRouterModule) ExportAll(ctx context.Context) ([]*router_dto.Export, error) {
72

Callers

nothing calls this directly

Calls 2

ListForServicesMethod · 0.65
ListInfoMethod · 0.65

Tested by

no test coverage detected