utl

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Key = []byte("0123456789ABCDEFFEDCBA9876543210")
)

Functions

func Command

func Command(cmds ...string) (string, error)

func Contains

func Contains(s string, substrs ...string) bool

func CopyFile

func CopyFile(inFilePath, outFilePath string) error

func Decrypt

func Decrypt(data string) (string, error)

func Difference

func Difference[T any](s1, s2 []T, equal func(t1, t2 T) bool) ([]T, []T)

func Digest

func Digest(data string) string

func ElapsedTime

func ElapsedTime(method string, begin time.Time)

func Encrypt

func Encrypt(data string) (string, error)

func Exist

func Exist(name string) bool

func ForParallel

func ForParallel[T any](s []T, iterate func(t T) error, size int)

func GetIp

func GetIp() (string, error)

func GetMac

func GetMac() (string, error)

func GetPort

func GetPort(min, max int) int

func Glob

func Glob(patterns ...string) []string

func HasPrefix

func HasPrefix(s string, prefixs ...string) bool

func HasSuffix

func HasSuffix(s string, suffixs ...string) bool

func HmacSha256

func HmacSha256(data string, secret string) string

func InsertAfter

func InsertAfter(s string, findinserts ...string) string

func InsertBefore

func InsertBefore(s string, findinserts ...string) string

func IntId

func IntId() int64

func Intersect

func Intersect[T any](s1, s2 []T, equal func(t1, t2 T) bool) []T

func MakeDir

func MakeDir(names ...string) error

func Md5

func Md5(data string) string

func ReadMetadata

func ReadMetadata(filePath string) (map[string]any, error)

func Remove

func Remove(names ...string) error

func RenameFile

func RenameFile(inFilePath, outFilePath string) error

func Replace

func Replace(s string, oldnews ...string) string

func Split

func Split(s string, seps ...rune) []string

func TakeStream

func TakeStream(outs map[string]map[string]any, in string, inArgs ...map[string]any) error

func TimeId

func TimeId() string

func Trim

func Trim(s string, cutsets ...string) string

func UnzipFile

func UnzipFile(inFilePath string, outFilePath ...string) error

func WriteMetadata

func WriteMetadata(inFilePath, outFilePath string, data map[string]any) error

func ZipFile

func ZipFile(inFilePath string, outFilePath ...string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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