utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Black       = Color("\033[0;30m%s\033[0m")
	Red         = Color("\033[0;31m%s\033[0m")
	Green       = Color("\033[0;32m%s\033[0m")
	Orange      = Color("\033[0;33m%s\033[0m")
	Blue        = Color("\033[0;34m%s\033[0m")
	Purple      = Color("\033[0;35m%s\033[0m")
	Cyan        = Color("\033[0;36m%s\033[0m")
	LightGray   = Color("\033[0;37m%s\033[0m")
	DarkGray    = Color("\033[1;30m%s\033[0m")
	LightRed    = Color("\033[1;31m%s\033[0m")
	LightGreen  = Color("\033[1;32m%s\033[0m")
	Yellow      = Color("\033[1;33m%s\033[0m")
	LightBlue   = Color("\033[1;34m%s\033[0m")
	LightPurple = Color("\033[1;35m%s\033[0m")
	LightCyan   = Color("\033[1;36m%s\033[0m")
	White       = Color("\033[1;37m%s\033[0m")
)

Colors variables

Functions

func AskForConfirmation

func AskForConfirmation() bool

AskForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and Source : https://gist.github.com/r0l1/3dcbb0c8f6cfe9c66ab8008f55f8f28b then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.

func Color

func Color(colorString string) func(...interface{}) string

Color return string in a color specified

func GenerateName

func GenerateName() string

GenerateName generate fake string similate to name

func ReadValue

func ReadValue() string

ReadValue read input from terminal and returns its value

func SetLogger

func SetLogger(verbose *bool) *zap.Logger

setLogger create logger with zap librairy

Types

This section is empty.

Jump to

Keyboard shortcuts

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