MCPcopy Create free account
hub / github.com/Scalingo/cli / List

Function List

apps/list.go:12–32  ·  view source on GitHub ↗
(ctx context.Context, renderer renderer.Renderer[[]*scalingo.App], projectSlug string)

Source from the content-addressed store, hash-verified

10)
11
12func List(ctx context.Context, renderer renderer.Renderer[[]*scalingo.App], projectSlug string) error {
13 c, err := config.ScalingoClient(ctx)
14 if err != nil {
15 return errors.Wrap(ctx, err, "get Scalingo client")
16 }
17
18 apps, err := c.AppsList(ctx)
19 if err != nil {
20 return errors.Wrap(ctx, err, "list apps")
21 }
22
23 filteredApps := filterAppsByProject(apps, projectSlug)
24 renderer.SetData(ctx, filteredApps)
25
26 err = renderer.Render(ctx)
27 if err != nil {
28 return errors.Wrap(ctx, err, "render apps list")
29 }
30
31 return nil
32}
33
34func filterAppsByProject(apps []*scalingo.App, projectSlug string) []*scalingo.App {
35 if projectSlug == "" {

Callers 1

apps.goFile · 0.92

Calls 4

ScalingoClientFunction · 0.92
filterAppsByProjectFunction · 0.85
SetDataMethod · 0.65
RenderMethod · 0.65

Tested by

no test coverage detected