spinner

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Spinner)

func WithDisableOutputResult

func WithDisableOutputResult() Option

WithDisableOutputResult disable output result.

func WithPrompt

func WithPrompt(prompt string) Option

WithPrompt replace default prompt

func WithQuitKey added in v0.7.5

func WithQuitKey(key key.Binding) Option

WithQuitKey replace `Quit` key, user interrupt, kill program.

func WithShape

func WithShape(shape components.Shape) Option

WithShape default is Line

func WithShapeStyle

func WithShapeStyle(style *style.Style) Option

WithShapeStyle default theme.DefaultTheme#SpinnerShapeStyle

type Spinner

type Spinner struct {
	*components.PrintHelper
	// contains filtered or unexported fields
}

func New

func New(ops ...Option) *Spinner

New Spinner

func (*Spinner) Apply

func (s *Spinner) Apply(ops ...Option) *Spinner

Apply options on Select

func (*Spinner) Display

func (s *Spinner) Display(runner func(spinner *Spinner)) error

Display Spinner

func (*Spinner) Finish

func (s *Spinner) Finish(prompt ...string)

Finish Spinner

func (*Spinner) Refresh

func (s *Spinner) Refresh(prompt string)

Refresh Spinner prompt

func (*Spinner) Refreshf

func (s *Spinner) Refreshf(format string, a ...any)

Refreshf Spinner prompt

Jump to

Keyboard shortcuts

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