gutils

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 21 Imported by: 34

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

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

func Closeq

func Closeq(v any)

func ComputeSum

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

func CopyAFile

func CopyAFile(source, destination string) error

CopyAFile copies the file at the source path to the provided destination.

func CopyDirectory

func CopyDirectory(source string, destination string, recursive bool) error

CopyDirectory copies the directory at the source path to the provided destination, with the option of recursively copying subdirectories.

func CopyFile

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

func ExecuteSysCommand

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

func FlushPathEnvForUnix

func FlushPathEnvForUnix() (err error)

func GetHomeDir

func GetHomeDir() string

func GetShell

func GetShell() (shell string)

func GetShellRcFile

func GetShellRcFile() (rc string)

func MakeDirs

func MakeDirs(dirs ...string)

func PathIsExist

func PathIsExist(path string) (bool, error)

func QuickSort

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

func RandomString

func RandomString(slength int) string

func VerifyUrls

func VerifyUrls(rawUrl string) (r bool)

Types

type CtrlCSignal

type CtrlCSignal struct {
	Sweeper func() error
}

Listen Signal: Ctrl+C

func (*CtrlCSignal) ListenSignal

func (that *CtrlCSignal) ListenSignal()

func (*CtrlCSignal) RegisterSweeper

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

type IComparable

type IComparable interface {
	Less(IComparable) bool
}

type UUID

type UUID [16]byte

func NewUUID

func NewUUID() *UUID

create a new uuid v4

func (*UUID) String

func (u *UUID) String() string

Jump to

Keyboard shortcuts

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