utils

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(str string) string

func CreateFile

func CreateFile(fname string) error

func DashedLine

func DashedLine(n int) string

func IsIn

func IsIn[T cmp.Ordered](element T, array []T) bool

func Message

func Message(msg string, msgtype MessageType, newline bool, color ...ColorType)

func PromptBool

func PromptBool(msg string, def bool) (bool, error)

func PromptString

func PromptString(msg string, def string) (string, error)

Types

type ColorType

type ColorType = string
const (
	ColorReset  ColorType = "\033[0m"
	ColorRed    ColorType = "\033[31m"
	ColorGreen  ColorType = "\033[32m"
	ColorBlue   ColorType = "\033[34m"
	ColorCyan   ColorType = "\033[36m"
	ColorYellow ColorType = "\033[33m"
	ColorPurple ColorType = "\033[35m"
	ColorGray   ColorType = "\033[30m"
)

type HighlightType

type HighlightType = string
const (
	HiStrike HighlightType = "\033[9m"
	HiReset  HighlightType = "\033[0m"
)

type MessageType

type MessageType int64
const (
	Normal MessageType = iota
	Hint
	Warning
	Error
)

type TextStyle

type TextStyle = string

Jump to

Keyboard shortcuts

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