node

package
v4.2.0-alpha.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdLogs

func NewCmdLogs(baseName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdLogs creates a new logs command that supports OpenShift resources.

func NewMergeReader

func NewMergeReader(r ...Reader) io.WriterTo

NewMergeReader attempts to display the provided readers as line oriented output in lexographic order by always reading the next available line from the reader with the "smallest" line.

For example, given the readers with the following lines:

 1: A
    B
    D
 2: C
    D
    E

the reader would contain:
    A
    B
    C
    D
    D
    E

The merge reader uses bufio.NewReader() for each input and the ReadLine() method to find the next shortest input. If a given line is longer than the buffer size of 4096, and all readers have the same initial 4096 characters, the order is undefined.

Types

type LogsOptions

type LogsOptions struct {
	Resources []string
	Selector  string
	Role      string

	// the log path to fetch
	Path string

	// --path=journal specific arguments
	Grep              string
	GrepCaseSensitive bool
	Units             []string
	SinceTime         string
	UntilTime         string
	Tail              int
	Output            string

	// output format arguments
	Raw   bool
	Unify bool

	RESTClientGetter func(mapping *meta.RESTMapping) (resource.RESTClient, error)
	Builder          *resource.Builder

	genericclioptions.IOStreams
}

LogsOptions holds all the necessary options for running oc adm node-logs.

func NewLogsOptions

func NewLogsOptions(streams genericclioptions.IOStreams) *LogsOptions

func (*LogsOptions) Complete

func (o *LogsOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []string) error

func (LogsOptions) RunLogs

func (o LogsOptions) RunLogs() error

RunLogs retrieves node logs

func (LogsOptions) Validate

func (o LogsOptions) Validate() error

type Reader

type Reader struct {
	R      io.Reader
	Prefix []byte
}

Reader wraps an io.Reader and inserts the provided prefix at the beginning of the output and before each newline character found in the stream.

Jump to

Keyboard shortcuts

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