events

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdEvents

func NewCmdEvents(restClientGetter genericclioptions.RESTClientGetter, streams genericclioptions.IOStreams) *cobra.Command

NewCmdEvents creates a new events command

Types

type EventsFlags

type EventsFlags struct {
	RESTClientGetter genericclioptions.RESTClientGetter

	AllNamespaces bool
	Watch         bool
	ForObject     string
	ChunkSize     int64
	genericclioptions.IOStreams
}

EventsFlags directly reflect the information that CLI is gathering via flags. They will be converted to Options, which reflect the runtime requirements for the command. This structure reduces the transformation to wiring and makes the logic itself easy to unit test.

func NewEventsFlags

func NewEventsFlags(restClientGetter genericclioptions.RESTClientGetter, streams genericclioptions.IOStreams) *EventsFlags

NewEventsFlags returns a default EventsFlags

func (*EventsFlags) AddFlags

func (o *EventsFlags) AddFlags(cmd *cobra.Command)

AddFlags registers flags for a cli.

func (*EventsFlags) ToOptions

func (flags *EventsFlags) ToOptions(ctx context.Context, args []string) (*EventsOptions, error)

ToOptions converts from CLI inputs to runtime inputs.

type EventsOptions

type EventsOptions struct {
	Namespace     string
	AllNamespaces bool
	Watch         bool

	genericclioptions.IOStreams
	// contains filtered or unexported fields
}

EventsOptions is a set of options that allows you to list events. This is the object reflects the runtime needs of an events command, making the logic itself easy to unit test.

func (EventsOptions) Run

func (o EventsOptions) Run() error

Run retrieves events

type SortableEvents

type SortableEvents []corev1.Event

SortableEvents implements sort.Interface for []api.Event by time

func (SortableEvents) Len

func (list SortableEvents) Len() int

func (SortableEvents) Less

func (list SortableEvents) Less(i, j int) bool

func (SortableEvents) Swap

func (list SortableEvents) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL