gutils

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 19 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Win     string = "win"
	Zsh     string = "zsh"
	Bash    string = "bash"
	Windows string = "windows"
	Darwin  string = "darwin"
	Linux   string = "linux"
)

Variables

This section is empty.

Functions

func CheckSum added in v0.2.0

func CheckSum(fpath, cType, cSum string) (r bool)

func Closeq

func Closeq(v any)

func ComputeSum added in v0.2.0

func ComputeSum(fpath, sumType string) (sumStr string)

func CopyFile added in v0.2.0

func CopyFile(src, dst string) (written int64, err error)

func ExecuteSysCommand added in v0.2.6

func ExecuteSysCommand(collectOutput bool, workDir string, args ...string) (*bytes.Buffer, error)

func FlushPathEnvForUnix added in v0.2.6

func FlushPathEnvForUnix() (err error)

func GetHomeDir added in v0.2.6

func GetHomeDir() string

func GetShell added in v0.2.6

func GetShell() (shell string)

func GetShellRcFile added in v0.2.6

func GetShellRcFile() (rc string)

func MakeDirs

func MakeDirs(dirs ...string)

func PathIsExist

func PathIsExist(path string) (bool, error)

func QuickSort added in v0.3.3

func QuickSort(itemList []IComparable, left, right int)

func RandomString added in v0.2.8

func RandomString(slength int) string

func VerifyUrls added in v0.2.1

func VerifyUrls(rawUrl string) (r bool)

Types

type CtrlCSignal added in v0.1.7

type CtrlCSignal struct {
	Sweeper func() error
}

Listen Signal: Ctrl+C

func (*CtrlCSignal) ListenSignal added in v0.1.7

func (that *CtrlCSignal) ListenSignal()

func (*CtrlCSignal) RegisterSweeper added in v0.2.6

func (that *CtrlCSignal) RegisterSweeper(f func() error)

type IComparable added in v0.3.3

type IComparable interface {
	Less(IComparable) bool
}

type UUID added in v0.2.8

type UUID [16]byte

func NewUUID added in v0.2.8

func NewUUID() *UUID

create a new uuid v4

func (*UUID) String added in v0.2.8

func (u *UUID) String() string

Jump to

Keyboard shortcuts

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