moe

package module
v0.0.0-...-f93a640 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 5 Imported by: 4

README

moe

simple cli spinner by go.

Usage

go get -u github.com/hellokaton/moe
moe := moe.New("正在为您加载").Start()
time.Sleep(4 * time.Second)
moe.Stop()

License

MIT

Documentation

Index

Constants

View Source
const (
	// Red red color code
	Red = 31 + iota
	// Green greent color code
	Green
	// Yellow yellow color code
	Yellow
	// Blue blue color code
	Blue
	// Magenta magenta color code
	Magenta
	// White white color code
	White
)
View Source
const ClearLine = "\r\033[K"

ClearLine go to the beggining of the line and clear it

Variables

View Source
var SpinnerMap map[string]Moe

SpinnerMap spinners

Functions

This section is empty.

Types

type Moe

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

Moe spinner type

func New

func New(text string) *Moe

New Spinner with args

func (*Moe) Color

func (m *Moe) Color(color int) *Moe

Color spinner color

func (*Moe) Frame

func (m *Moe) Frame(frames []string) *Moe

Frame custom frames

func (*Moe) Speed

func (m *Moe) Speed(speed time.Duration) *Moe

Speed speed

func (*Moe) Spinner

func (m *Moe) Spinner(name string) *Moe

Spinner default spinner

func (*Moe) Start

func (m *Moe) Start() *Moe

Start shows the spinner.

func (*Moe) Stop

func (m *Moe) Stop() bool

Stop hide spinner

func (*Moe) Text

func (m *Moe) Text(text string) *Moe

Text set spinner text

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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