printer

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 9 Imported by: 11

README

go-printer

GoDoc

syntactic sugar on fmt for nicer printing

Documentation

Index

Constants

View Source
const BlueColor = "\x1b[94m"

Blue is the blue color string constant

View Source
const BoldString = "\033[1m"
View Source
const CyanColor = "\x1b[36m"
View Source
const GreenColor = "\x1b[32m"
View Source
const NoColor = "\x1b[0m"

Nc is the no color string constant

View Source
const NoboldString = "\033[0m"
View Source
const RedColor = "\x1b[31m"
View Source
const YellowColor = "\x1b[33m"

Variables

View Source
var ErrorIcon = "✗"
View Source
var InfoIcon = "🐧"
View Source
var SuccessIcon = "✔"
View Source
var Verbose = false

Enables verbose printing

View Source
var WarningIcon = "⚠"

Functions

func Blue

func Blue(text string) string

func Bluef

func Bluef(text string, a ...interface{}) string

func Bold

func Bold(text string) string

func Boldf

func Boldf(text string, a ...interface{}) string

func ColoredString added in v0.1.3

func ColoredString(text string) string

func Cyan added in v0.1.2

func Cyan(text string) string

func Cyanf added in v0.1.2

func Cyanf(text string, a ...interface{}) string

func Error

func Error(text string, a ...interface{})

func ErrorBar

func ErrorBar(text string, a ...interface{})

func ErrorBarIcon

func ErrorBarIcon(text string, a ...interface{})

func ErrorLine

func ErrorLine()

func ErrorLineBottom

func ErrorLineBottom()

func ErrorLineText

func ErrorLineText(text string, a ...interface{})

func ErrorLineTextTop

func ErrorLineTextTop(text string, a ...interface{})

func ErrorLineTop

func ErrorLineTop()

func Fail

func Fail(text string, a ...interface{})

func Green

func Green(text string) string

func Greenf

func Greenf(text string, a ...interface{}) string

func Info

func Info(text string, a ...interface{})

func InfoBar

func InfoBar(text string, a ...interface{})

func InfoBarIcon

func InfoBarIcon(text string, a ...interface{})

func InfoLine

func InfoLine()

func InfoLineBottom

func InfoLineBottom()

func InfoLineText

func InfoLineText(text string, a ...interface{})

func InfoLineTextTop

func InfoLineTextTop(text string, a ...interface{})

func InfoLineTop

func InfoLineTop()

func PrintColored added in v0.1.2

func PrintColored(text string, a ...interface{})

func PrintColoredln added in v0.1.2

func PrintColoredln(text string, a ...interface{})

func Red

func Red(text string) string

func Redf

func Redf(text string, a ...interface{}) string

func StartSpinners added in v0.2.1

func StartSpinners() (wg *sync.WaitGroup)

func Success

func Success(text string, a ...interface{})

func SuccessBar

func SuccessBar(text string, a ...interface{})

func SuccessBarIcon

func SuccessBarIcon(text string, a ...interface{})

func SuccessLine

func SuccessLine()

func SuccessLineBottom

func SuccessLineBottom()

func SuccessLineText

func SuccessLineText(text string, a ...interface{})

func SuccessLineTextTop

func SuccessLineTextTop(text string, a ...interface{})

func SuccessLineTop

func SuccessLineTop()

func VerboseError

func VerboseError(text string, a ...interface{})

func VerboseErrorBar

func VerboseErrorBar(text string, a ...interface{})

func VerboseFail

func VerboseFail(text string, a ...interface{})

func VerboseInfo

func VerboseInfo(text string, a ...interface{})

func VerboseInfoBar

func VerboseInfoBar(text string, a ...interface{})

func VerboseSuccess

func VerboseSuccess(text string, a ...interface{})

func VerboseSuccessBar

func VerboseSuccessBar(text string, a ...interface{})

func VerboseWarning

func VerboseWarning(text string, a ...interface{})

func VerboseWarningBar

func VerboseWarningBar(text string, a ...interface{})

func WaitAllSpinners added in v0.2.1

func WaitAllSpinners()

func Warning

func Warning(text string, a ...interface{})

func WarningBar

func WarningBar(text string, a ...interface{})

func WarningBarIcon

func WarningBarIcon(text string, a ...interface{})

func WarningLine

func WarningLine()

func WarningLineBottom

func WarningLineBottom()

func WarningLineText

func WarningLineText(text string, a ...interface{})

func WarningLineTextTop

func WarningLineTextTop(text string, a ...interface{})

func WarningLineTop

func WarningLineTop()

func Yellow

func Yellow(text string) string

func Yellowf

func Yellowf(text string, a ...interface{}) string

Types

type TaskSpinner added in v0.2.1

type TaskSpinner struct {
	Prefix   string
	State    int
	FinalMSG string
	MSG      string
	Name     string
	Ch       chan string

	SpinStates []string
	// contains filtered or unexported fields
}

func AddSpinner added in v0.2.1

func AddSpinner(name string) *TaskSpinner

func NewTaskSpinner added in v0.2.1

func NewTaskSpinner(name string) *TaskSpinner

func (*TaskSpinner) Fail added in v0.2.1

func (t *TaskSpinner) Fail()

Fail set the task to the failure state. This will also stop the spinner and close its channel.

func (*TaskSpinner) Success added in v0.2.1

func (t *TaskSpinner) Success()

Success set the task to the succesful state. This will also stop the spinner and close its channel.

Jump to

Keyboard shortcuts

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