Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = cli.Command{ Name: "events", Aliases: []string{"event"}, Usage: "display containerd events", Action: func(context *cli.Context) error { client, ctx, cancel, err := commands.NewClient(context) if err != nil { return err } defer cancel() eventsClient := client.EventService() eventsCh, errCh := eventsClient.Subscribe(ctx, context.Args()...) for { var e *events.Envelope select { case evt, closed := <-eventsCh: if closed { return nil } e = evt case err := <-errCh: return err } var out []byte if e.Event != nil { v, err := typeurl.UnmarshalAny(e.Event) if err != nil { return err } out, err = json.Marshal(v) if err != nil { return err } } if _, err := fmt.Println( e.Timestamp, e.Namespace, e.Topic, string(out), ); err != nil { return err } } }, }
Command is the cli command for displaying containerd events
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.