utils

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Timing []timeLog

Functions

func DisplayProfileData

func DisplayProfileData()

func FailOnError

func FailOnError(err error)

func FailOnErrorWithMessage

func FailOnErrorWithMessage(err error, message string)

func FileHash

func FileHash(filePath string) (string, error)

func LogTime

func LogTime(operation string)

func ShowError

func ShowError(err error)

func ShowErrorWithMessage

func ShowErrorWithMessage(err error, message string)

func ShowSpinner

func ShowSpinner(msg string) *spinner.Spinner

ShowSpinner :: starts a spinner with a given message

func ShowWarning

func ShowWarning(warning string)

func StopSpinner

func StopSpinner(spinner *spinner.Spinner)

StopSpinner :: stops a spinner instance and clears it

func StopSpinnerWithMessage

func StopSpinnerWithMessage(spinner *spinner.Spinner, finalMsg string)

StopSpinnerWithMessage :: stops a spinner instance and clears it, after writing `finalMsg`

func StringHash

func StringHash(s string) uint32

Types

type ExitCode

type ExitCode int

ExitCode :: alias for exitcode

type InteractiveExitStatus

type InteractiveExitStatus struct {
	ExitCode int
	Restart  bool
}

InteractiveExitStatus :: exist status from the interative prompt

We exit go-prompt after every query (in order to manage the prompt history to only include complete queries) We therefore need to distinguish between:

a user requested exit (ctrl+D or .exit) - indicated by a non-nil exit code and restart=false and a value , go-prompt being terminated after a query completion and requiring restarting - indicated by restart=true

Jump to

Keyboard shortcuts

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