helper

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCase

func CamelCase(s string) string

k 是控制首写字母大小写的, j 预计控制-后面的首写字母

func Fatal

func Fatal(err error, title string)

func GenFile

func GenFile(tplContent string, dest string, data map[string]interface{})

func GetDcValueByKeys

func GetDcValueByKeys(source string, keysParam ...string) string

func GetFileNameByUri

func GetFileNameByUri(uri string) (res string)

func GetFilePath

func GetFilePath(relativePath string) string

相对于当前程序运行目录的,绝对路径

func GetLastSymBolAfterStr

func GetLastSymBolAfterStr(source string, symbol string) (res string)

func GetWorkDir

func GetWorkDir() string

func Gzip

func Gzip(str string) string

func IsFileExist

func IsFileExist(filepath string) bool

func IsFilePathExist

func IsFilePathExist(filepath string) bool

判断api 文件是否存在

func LoadResource

func LoadResource(dir string) map[string]string

遍历文件夹,把静态文件读取出来 map["SERVICE_TPL"]=文件里面的内

func LoadYamlFile

func LoadYamlFile(relativePath string) []byte

func MakeDirByPathIfNotExist

func MakeDirByPathIfNotExist(path string)

判断目录是否存在,要在path 最后面加"/"

func NewTplFunction

func NewTplFunction() template.FuncMap

func ReadFile

func ReadFile(f string) []byte

func SnakeCase

func SnakeCase(s string) string

下划线模式

func Ucfirst

func Ucfirst(str string) string

func UnGzip

func UnGzip(str string) string

func WriteFileIfNotExistsCon

func WriteFileIfNotExistsCon(absolute string, con string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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