clispinner

package
v28.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultText = "Initializing..."

DefaultText defines the default spinner text.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func WithCharset added in v28.8.1

func WithCharset(charset []string) Option

WithCharset configures the spinner charset.

func WithText

func WithText(text string) Option

WithText configures the spinner text.

func WithWriter

func WithWriter(w io.Writer) Option

WithWriter configures an output for a spinner.

type Options

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

type SimpleSpinner added in v28.8.1

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

func (*SimpleSpinner) IsActive added in v28.8.1

func (s *SimpleSpinner) IsActive() bool

IsActive returns whether the spinner is currently active.

func (*SimpleSpinner) SetCharset added in v28.8.1

func (s *SimpleSpinner) SetCharset(charset []string) Spinner

SetCharset sets the charset for the spinner.

func (*SimpleSpinner) SetColor added in v28.8.1

func (s *SimpleSpinner) SetColor(color string) Spinner

SetColor sets the color for the spinner (if color functionality is added).

func (*SimpleSpinner) SetPrefix added in v28.8.1

func (s *SimpleSpinner) SetPrefix(prefix string) Spinner

SetPrefix sets the prefix for the spinner.

func (*SimpleSpinner) SetText added in v28.8.1

func (s *SimpleSpinner) SetText(text string) Spinner

SetText sets the text for the spinner.

func (*SimpleSpinner) Start added in v28.8.1

func (s *SimpleSpinner) Start() Spinner

Start begins the spinner animation.

func (*SimpleSpinner) Stop added in v28.8.1

func (s *SimpleSpinner) Stop() Spinner

Stop ends the spinner animation.

func (*SimpleSpinner) Writer added in v28.8.1

func (s *SimpleSpinner) Writer() io.Writer

Writer returns the spinner writer.

type Spinner

type Spinner interface {
	SetText(text string) Spinner
	SetPrefix(text string) Spinner
	SetCharset(charset []string) Spinner
	SetColor(color string) Spinner
	Start() Spinner
	Stop() Spinner
	IsActive() bool
	Writer() io.Writer
}

func New

func New(options ...Option) Spinner

New creates a new spinner.

type TermSpinner added in v28.8.1

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

func (*TermSpinner) IsActive added in v28.8.1

func (s *TermSpinner) IsActive() bool

IsActive returns whether the spinner is currently active.

func (*TermSpinner) SetCharset added in v28.8.1

func (s *TermSpinner) SetCharset(charset []string) Spinner

SetCharset sets the prefix for spinner.

func (*TermSpinner) SetColor added in v28.8.1

func (s *TermSpinner) SetColor(color string) Spinner

SetColor sets the prefix for spinner.

func (*TermSpinner) SetPrefix added in v28.8.1

func (s *TermSpinner) SetPrefix(text string) Spinner

SetPrefix sets the prefix for spinner.

func (*TermSpinner) SetText added in v28.8.1

func (s *TermSpinner) SetText(text string) Spinner

SetText sets the text for spinner.

func (*TermSpinner) Start added in v28.8.1

func (s *TermSpinner) Start() Spinner

Start starts spinning.

func (*TermSpinner) Stop added in v28.8.1

func (s *TermSpinner) Stop() Spinner

Stop stops spinning.

func (*TermSpinner) Writer added in v28.8.1

func (s *TermSpinner) Writer() io.Writer

Writer returns the spinner writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳