kind: sigs.k8s.io/kind/pkg/internal/util/cli Index | Files

package cli

import "sigs.k8s.io/kind/pkg/internal/util/cli"

Index

Package Files

logger.go spinner.go status.go

type Logger Uses

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

Logger is the kind cli's log.Logger implementation

func NewLogger Uses

func NewLogger(writer io.Writer, verbosity log.Level) *Logger

NewLogger returns a new Logger with the given verbosity

func (*Logger) Error Uses

func (l *Logger) Error(message string)

Error is part of the log.Logger interface

func (*Logger) Errorf Uses

func (l *Logger) Errorf(format string, args ...interface{})

Errorf is part of the log.Logger interface

func (*Logger) SetVerbosity Uses

func (l *Logger) SetVerbosity(verbosity log.Level)

SetVerbosity sets the loggers verbosity

func (*Logger) SetWriter Uses

func (l *Logger) SetWriter(w io.Writer)

SetWriter sets the output writer

func (*Logger) V Uses

func (l *Logger) V(level log.Level) log.InfoLogger

V is part of the log.Logger interface

func (*Logger) Warn Uses

func (l *Logger) Warn(message string)

Warn is part of the log.Logger interface

func (*Logger) Warnf Uses

func (l *Logger) Warnf(format string, args ...interface{})

Warnf is part of the log.Logger interface

type Spinner Uses

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

Spinner is a simple and efficient CLI loading spinner used by kind It is simplistic and assumes that the line length will not change.

func NewSpinner Uses

func NewSpinner(w io.Writer) *Spinner

NewSpinner initializes and returns a new Spinner that will write to w NOTE: w should be os.Stderr or similar, and it should be a Terminal

func (*Spinner) SetPrefix Uses

func (s *Spinner) SetPrefix(prefix string)

SetPrefix sets the prefix to print before the spinner

func (*Spinner) SetSuffix Uses

func (s *Spinner) SetSuffix(suffix string)

SetSuffix sets the suffix to print after the spinner

func (*Spinner) Start Uses

func (s *Spinner) Start()

Start starts the spinner running

func (*Spinner) Stop Uses

func (s *Spinner) Stop()

Stop signals the spinner to stop

func (*Spinner) Write Uses

func (s *Spinner) Write(p []byte) (n int, err error)

Write implements io.Writer, interrupting the spinner and writing to the inner writer

type Status Uses

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

Status is used to track ongoing status in a CLI, with a nice loading spinner when attached to a terminal

func StatusForLogger Uses

func StatusForLogger(l log.Logger) *Status

StatusForLogger returns a new status object for the logger l, if l is the kind cli logger and the writer is a Spinner, that spinner will be used for the status

func (*Status) End Uses

func (s *Status) End(success bool)

End completes the current status, ending any previous spinning and marking the status as success or failure

func (*Status) Start Uses

func (s *Status) Start(status string)

Start starts a new phase of the status, if attached to a terminal there will be a loading spinner with this status

Package cli imports 9 packages (graph) and is imported by 7 packages. Updated 2019-11-11. Refresh now. Tools for package owners.