clispinner

package
v29.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 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

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

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

func (*SimpleSpinner) IsActive

func (s *SimpleSpinner) IsActive() bool

IsActive returns whether the spinner is currently active.

func (*SimpleSpinner) SetCharset

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

SetCharset sets the charset for the spinner.

func (*SimpleSpinner) SetColor

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

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

func (*SimpleSpinner) SetPrefix

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

SetPrefix sets the prefix for the spinner.

func (*SimpleSpinner) SetText

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

SetText sets the text for the spinner.

func (*SimpleSpinner) Start

func (s *SimpleSpinner) Start() Spinner

Start begins the spinner animation.

func (*SimpleSpinner) Stop

func (s *SimpleSpinner) Stop() Spinner

Stop ends the spinner animation.

func (*SimpleSpinner) Writer

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

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

func (*TermSpinner) IsActive

func (s *TermSpinner) IsActive() bool

IsActive returns whether the spinner is currently active.

func (*TermSpinner) SetCharset

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

SetCharset sets the prefix for spinner.

func (*TermSpinner) SetColor

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

SetColor sets the prefix for spinner.

func (*TermSpinner) SetPrefix

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

SetPrefix sets the prefix for spinner.

func (*TermSpinner) SetText

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

SetText sets the text for spinner.

func (*TermSpinner) Start

func (s *TermSpinner) Start() Spinner

Start starts spinning.

func (*TermSpinner) Stop

func (s *TermSpinner) Stop() Spinner

Stop stops spinning.

func (*TermSpinner) Writer

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