util

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: GPL-2.0, GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RESET  = "\033[0m"
	RED    = "\033[31m"
	GREEN  = "\033[32m"
	YELLOW = "\033[33m"
	BLUE   = "\033[34m"
	PURPLE = "\033[35m"
	CYAN   = "\033[36m"
	GRAY   = "\033[37m"
	WHITE  = "\033[97m"
)
View Source
var (
	APPNAME    = "bibman"
	AUTHOR     = "KMIJPH"
	REPOSITORY = fmt.Sprintf("https://codeberg.org/%s/%s", AUTHOR, APPNAME)
	CONFIGDIR  = "unknown"
	DATADIR    = "unknown"
	DATABASE   = "unknown"
	VERSION    = "unknown"
)

Functions

func ArrayRemove added in v0.0.4

func ArrayRemove[T any](array []T, s int) []T

removes an entry from a slice (ordered, slower)

func CopyFile

func CopyFile(file string, destination string)

copies file

func GetMail added in v0.0.4

func GetMail() (string, error)

returns MAILADDR env var

func HandleError

func HandleError(err error, message string)

handles error

func HandleSuccess

func HandleSuccess(err error, message string)

handles success

func HandleWarning

func HandleWarning(err error, message string)

handles warning

func MkDir

func MkDir(parts ...string) (string, error)

creates directory if it doesn't exist

func ReadStdin

func ReadStdin() string

returns string read from stdin

func RunCmd

func RunCmd(command string) error

executes command

Types

This section is empty.

Jump to

Keyboard shortcuts

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