cli

package
v0.0.0-...-3b3e3cc Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

The package cli implements the command line interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute is the main entry point to the CLI. It executes the commands and arguments provided in os.Args[1:]

Types

type OS

type OS struct {
	Name    string
	Version string
	ID      string
	ID_LIKE string
}

type RingBuffer

type RingBuffer struct {
	// contains filtered or unexported fields
}

RingBuffer provides a simple ring buffer for buffering output from an output and error writer. Regular and error output are intermixed but on a line-level.

func NewRingBuffer

func NewRingBuffer(lineCount, lineLength int) *RingBuffer

NewRingBuffer creates a new ring buffer with a maximum number of lines and line lengths.

func (*RingBuffer) Flush

func (rb *RingBuffer) Flush()

Flush flushes all line buffers.

func (*RingBuffer) Read

func (rb *RingBuffer) Read(p []byte) (int, error)

Read reads a line from the ring buffer into the provided buffer. It returns the number of characters read or an error code. If there are no more lines to read, a length of 0 and io.EOF error is returned.

func (*RingBuffer) Reset

func (rb *RingBuffer) Reset()

Reset resets the entire ring buffer (including line buffers)

func (*RingBuffer) StreamWriter

func (rb *RingBuffer) StreamWriter() runtime.Stream

StreamReader returns a runtime Stream for the RingBuffer for StdOut and StdErr.

Jump to

Keyboard shortcuts

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