util

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTTY

func IsTTY() bool

IsTTY indicates whether the current stdout is a TTY

func NewValidatedRedisClient

func NewValidatedRedisClient(opts *RedisOpts) (*redis.Client, error)

NewValidatedRedisClient creates a new redis client and performs a PING before returning it

Types

type RedisOpts

type RedisOpts struct {
	RedisAddr        string
	RedisUseSentinel bool
}

RedisOpts contains redis configuration

type Spinner

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

Spinner keeps track of a message and a spin character. It can be used to indicate progress in between processing work items by repeatedly calling Tick()

func NewSpinner

func NewSpinner(msg string) *Spinner

NewSpinner creates a spinner with the provided message. This message will be printed together with the current spin character. It may be empty

func (*Spinner) Tick

func (s *Spinner) Tick()

Tick prints the spinner character to stdout and advances the spinner by one tick

func (*Spinner) TickWithUpdate

func (s *Spinner) TickWithUpdate(update string)

TickWithUpdate prints the spinner message to stdout and advances the spinner by one tick

Jump to

Keyboard shortcuts

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