kit

package
v1.0.0-beta.8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LintGonicMapper = map[string]bool{
	"API":   true,
	"ASCII": true,
	"CPU":   true,
	"CSS":   true,
	"DNS":   true,
	"EOF":   true,
	"GUID":  true,
	"HTML":  true,
	"HTTP":  true,
	"HTTPS": true,
	"ID":    true,
	"IP":    true,
	"JSON":  true,
	"LHS":   true,
	"QPS":   true,
	"RAM":   true,
	"RHS":   true,
	"RPC":   true,
	"SLA":   true,
	"SMTP":  true,
	"SSH":   true,
	"TLS":   true,
	"TTL":   true,
	"UI":    true,
	"UID":   true,
	"UUID":  true,
	"URI":   true,
	"URL":   true,
	"UTF8":  true,
	"VM":    true,
	"XML":   true,
	"XSRF":  true,
	"XSS":   true,
}

Functions

func Add

func Add(y, x int) int

func ContainsString

func ContainsString(collection []string, element string) bool

func Copy

func Copy(dstFile string, src io.Reader) (written int64, err error)

Copy copies a file from src to dist

func CopyFile

func CopyFile(src, dist string) error

CopyFile copies a file from src to dist

func Exec

func Exec(cmd string, args ...string)

func FirstLower

func FirstLower(str string) string

func FirstUpper

func FirstUpper(str string) string

func GonicCase

func GonicCase(str string) string

func IsFileOrDirExist

func IsFileOrDirExist(f string) (bool, error)

IsFileOrDirExist 判断文件或目录是否存在

func IsIDEmpty

func IsIDEmpty(id interface{}) bool

func IsLastIndex

func IsLastIndex(idx int, s any) bool

func LineString

func LineString(str string) string

func Lookup

func Lookup(filename string, tier int) (path string, err error)

Lookup 查找路径,如果不存在则向父路径查找

func ReadJSONFile

func ReadJSONFile(f string, data any) error

ReadJSONFile 从文件读取json数据

func SnakeCase

func SnakeCase(str string) string

SnakeCase 下划线命名

func Sub

func Sub(y, x int) int

func TitleCase

func TitleCase(str string) string

func ToString

func ToString(src interface{}) string

func Unzip

func Unzip(src, dir string) error

Unzip 解压 zip 包

Types

This section is empty.

Jump to

Keyboard shortcuts

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