util

package
v1.0.4-0...-60f6aa3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CfgKeyName  = "PublicName"
	CfgKeyDesc  = "PublicDescription"
	CfgKeyPub   = "Public"
	CfgKeyPass  = "Password"
	CfgKeyMax   = "MaxPlayers"
	CfgKeyMods  = "Mods"
	CfgKeyItems = "WorkshopItems"
	CfgKeyMap   = "Map"
)

Variables

View Source
var (
	Info      = color.New(color.FgBlue).Sprint("INFO")
	Warning   = color.New(color.FgYellow).Sprint("WARNING")
	Error     = color.New(color.FgRed).Sprint("ERROR")
	OK        = color.New(color.FgGreen).Sprint("OK")
	Yes       = color.New(color.FgGreen).Sprint("YES")
	No        = color.New(color.FgRed).Sprint("NO")
	Bold      = color.New(color.Bold).SprintFunc()
	Underline = color.New(color.Underline).SprintFunc()
)
View Source
var (
	ErrFileNotFound = errors.New("file not found")
	ErrFileExists   = errors.New("file already exists")
	ErrInvalidKey   = errors.New("invalid key")
	ErrVerNotSet    = errors.New("version not set")
	ErrNoApiKey     = errors.New("no Steam API key set")
	ErrNoCredFile   = errors.New("no credentials file found")
)

Functions

func BoolString

func BoolString(b bool) string

func Contains

func Contains(list []string, item string) bool

func Dedupe

func Dedupe(list []string) []string

func DeleteCredentials

func DeleteCredentials() error

func FileExists

func FileExists(path string) bool

func Filter

func Filter(list []string, filter func(string) bool) []string

func GetCredentialsPath

func GetCredentialsPath() (string, error)

func HumanizeBytes

func HumanizeBytes(bytes uint64) string

func IndexOf

func IndexOf(list []string, item string) int

func IsDir

func IsDir(path string) bool

func LoadCredentials

func LoadCredentials() (string, error)

func Paren

func Paren(s string) string

func ParseBool

func ParseBool(s string) bool

func Quote

func Quote(s string) string

func StoreCredentials

func StoreCredentials(apiKey string) error

func YesNo

func YesNo(b bool) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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