Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package cmd
import (
"fmt"
"github.com/jessevdk/go-flags"
)
func SetupXbusActorListCmd[E any](program *Program[E], cmd *flags.Command) *XbusActorListCmd[E] {
serveCmd := XbusActorListCmd[E]{
program: program,
}
_, err := cmd.AddCommand("actor-list", "List all the available actor services", "", &serveCmd)
if err != nil {
panic(err)
}
return &serveCmd
}
//nolint:lll
type XbusActorListCmd[E any] struct {
program *Program[E]
}
func (cmd *XbusActorListCmd[E]) Execute([]string) error {
fmt.Printf("The following actor services are provided by %s:\n", cmd.program.Name)
for _, ff := range cmd.program.setupXbusActors {
for _, factory := range ff(cmd.program) {
fmt.Println("*", factory.Name)
}
}
return nil
}