MCPcopy Create free account
hub / github.com/auth0/auth0-cli / showEventStreamCmd

Function showEventStreamCmd

internal/cli/event_streams.go:133–173  ·  view source on GitHub ↗
(cli *cli)

Source from the content-addressed store, hash-verified

131}
132
133func showEventStreamCmd(cli *cli) *cobra.Command {
134 var inputs struct {
135 ID string
136 }
137
138 cmd := &cobra.Command{
139 Use: "show",
140 Args: cobra.MaximumNArgs(1),
141 Short: "Show an event stream",
142 Long: "Display the name, type, status, subscriptions and other information about an event stream",
143 Example: ` auth0 event-streams show
144 auth0 event-streams show <event-id>
145 auth0 event-streams show <event-id> --json
146 auth0 event-streams show <event-id> --json-compact`,
147 RunE: func(cmd *cobra.Command, args []string) error {
148 if len(args) == 0 {
149 if err := eventStreamID.Pick(cmd, &inputs.ID, cli.eventStreamPickerOptions); err != nil {
150 return err
151 }
152 } else {
153 inputs.ID = args[0]
154 }
155
156 var eventStream *management.EventStream
157
158 if err := ansi.Waiting(func() (err error) {
159 eventStream, err = cli.api.EventStream.Read(cmd.Context(), inputs.ID)
160 return err
161 }); err != nil {
162 return fmt.Errorf("failed to read event stream with ID %q: %w", inputs.ID, err)
163 }
164
165 return cli.renderer.EventStreamShow(eventStream)
166 },
167 }
168
169 cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.")
170 cmd.Flags().BoolVar(&cli.jsonCompact, "json-compact", false, "Output in compact json format.")
171
172 return cmd
173}
174
175func createEventStreamCmd(cli *cli) *cobra.Command {
176 var inputs struct {

Callers 1

eventStreamsCmdFunction · 0.85

Calls 5

WaitingFunction · 0.92
ErrorfMethod · 0.80
EventStreamShowMethod · 0.80
ReadMethod · 0.65
PickMethod · 0.45

Tested by

no test coverage detected