MCPcopy
hub / github.com/opencloud-eu/opencloud / List

Method List

opencloud/pkg/runtime/service/service.go:498–519  ·  view source on GitHub ↗

List running processes for the Service Controller.

(_ struct{}, reply *string)

Source from the content-addressed store, hash-verified

496
497// List running processes for the Service Controller.
498func (s *Service) List(_ struct{}, reply *string) error {
499 tableString := &strings.Builder{}
500 table := tablewriter.NewTable(tableString)
501 table.Header([]string{"Service"})
502
503 names := []string{}
504 for t := range s.serviceToken {
505 if len(s.serviceToken[t]) > 0 {
506 names = append(names, t)
507 }
508 }
509
510 sort.Strings(names)
511
512 for n := range names {
513 table.Append([]string{names[n]})
514 }
515
516 table.Render()
517 *reply = tableString.String()
518 return nil
519}
520
521func trapShutdownCtx(s *Service, srv *http.Server, ctx context.Context) error {
522 <-ctx.Done()

Callers

nothing calls this directly

Calls 2

RenderMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected