utils

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YamlConfigurationType = "yaml"
	JsonConfigurationType = "json"
	TomlConfigurationType = "toml"
)

Variables

View Source
var Colors = map[string]string{
	"red":     "\033[38;5;210m",
	"green":   "\033[32m",
	"yellow":  "\033[38;5;221m",
	"blue":    "\033[38;5;110m",
	"magenta": "\033[35m",
	"cyan":    "\033[36m",
	"gray":    "\033[90m",
	"orange":  "\033[38;5;214m",
	"pink":    "\033[38;5;207m",
	"lime":    "\033[38;5;10m",
	"white":   "\033[37m",
	"reset":   "\033[0m",
}
View Source
var ErrUnsupportedConfigType = errors.New("unsupported config type")

Functions

func CheckError

func CheckError(v any)

func Colorize

func Colorize(text, color string) string

func ExecuteAlias

func ExecuteAlias(command string, args []string, flags map[string]string, print bool)

func FileExists

func FileExists(path string) bool

func GetAlias

func GetAlias(aliasName string) string

func GetConfigurationType

func GetConfigurationType(path string) (string, error)

GetConfigurationType функция для определения типа конфигурации

func GetVariables added in v1.6.1

func GetVariables(input string, vars map[string]string) string

func GetVars added in v1.6.1

func GetVars() (map[string]string, error)

func TruncateString

func TruncateString(str string, maxLen int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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