utils

package
v0.0.0-...-9ca0f94 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

func DeleteLocalFile

func DeleteLocalFile(localFile string) (bool, error)

func DiffSet

func DiffSet(old, new map[string]struct{}) ([]string, []string)

DiffSet check a == b ? return diff

func EncryptPassword

func EncryptPassword(password string) (string, error)

func FileExists

func FileExists(path string) bool

FileExists check file exist

func FileMD5

func FileMD5(filePath string) (string, error)

func Float32

func Float32(v float32) *float32

func Hash

func Hash(s string) string

func Int32

func Int32(v int32) *int32

func IsSame

func IsSame(key string, a, b interface{}) bool

func ListFile

func ListFile(path string) []string

func MapToStruct

func MapToStruct(m map[string]interface{}, s interface{}) error

MapToStruct map to struct

func MatchPassword

func MatchPassword(password, encryptedPassword string) bool

func PortCheck

func PortCheck(port string, timeout int) bool

PortCheck port usable

func RandStr

func RandStr(length int) string

RandStr product random string

func String

func String(s string) *string

func TimestampMS

func TimestampMS() int64

func TimestampS

func TimestampS() int64

Types

type ExecItem

type ExecItem struct {
	Pid    int
	Status int
	Args   []string
	Output string
	Stdout io.ReadCloser
}

func DoExec

func DoExec(shell, dir string, env []string) *ExecItem

func DoExecAsync

func DoExecAsync(shell, dir string, env []string) (*ExecItem, error)

Jump to

Keyboard shortcuts

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