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

Method allLogStreamsPickerOptions

internal/cli/log_streams.go:283–301  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

281}
282
283func (c *cli) allLogStreamsPickerOptions(ctx context.Context) (pickerOptions, error) {
284 logStreams, err := c.api.LogStream.List(ctx)
285 if err != nil {
286 return nil, fmt.Errorf("failed to list log streams: %w", err)
287 }
288
289 var options pickerOptions
290 for _, logStream := range logStreams {
291 value := logStream.GetID()
292 label := fmt.Sprintf("%s %s", logStream.GetName(), ansi.Faint("("+value+")"))
293 options = append(options, pickerOption{value: value, label: label})
294 }
295
296 if len(options) == 0 {
297 return nil, errors.New("there are currently no log streams to choose from. Create one by running: `auth0 logs streams create`")
298 }
299
300 return options, nil
301}
302
303func (c *cli) logStreamPickerOptionsByType(desiredType logStreamType) pickerOptionsFunc {
304 return func(ctx context.Context) (pickerOptions, error) {

Callers 1

Calls 4

FaintFunction · 0.92
ErrorfMethod · 0.80
ListMethod · 0.65
GetNameMethod · 0.65

Tested by 1