...

Package json

import "sigs.k8s.io/cli-utils/cmd/status/printers/json"
Overview
Index

Overview ▾

type Printer

Printer implements the Printer interface and outputs the resource status information as a list of events as they happen.

type Printer struct {
    Formatter list.Formatter
    IOStreams genericclioptions.IOStreams
    Data      *printer.PrintData
}

func NewPrinter

func NewPrinter(ioStreams genericclioptions.IOStreams, printData *printer.PrintData) *Printer

NewPrinter returns a new instance of the eventPrinter.

func (*Printer) Print

func (ep *Printer) Print(ch <-chan pollevent.Event, identifiers object.ObjMetadataSet,
    cancelFunc collector.ObserverFunc) error

Print takes an event channel and outputs the status events on the channel until the channel is closed. The provided cancelFunc is consulted on every event and is responsible for stopping the poller when appropriate. This function will block.