utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DSNError = errors.New("dsn string error")

Functions

func CamelizeStr

func CamelizeStr(s string, upperCase bool) string

CamelizeStr

@Description: 		转换驼峰格式
@param s			字符串
@param upperCase	true=首字母大写
@return string

func CleanUpGenFiles

func CleanUpGenFiles(dir string) error

CleanUpGenFiles

@Description:	删除指定目录下所有文件
@param dir
@return error

func FileExists

func FileExists(filePath string) (bool, error)

FileExists

@Description: 	判断文件是否存在
@param filePath	文件路径
@return bool
@return error

func FirstCharacter

func FirstCharacter(s string) string

FirstCharacter

@Description:	获取首字母
@param s		字符串
@return string

func FirstLowerWord

func FirstLowerWord(s string) string

FirstLowerWord

@Description:	首字母小写
@param s		字符串
@return string

func GetDbNameFromDSN

func GetDbNameFromDSN(dsn string) (string, error)

GetDbNameFromDSN

@Description:
@param dsn
@return string
@return error

func InSlice

func InSlice(items []string, item string) bool

InSlice

@Description: 判断是否在切片中
@param items	切片
@param item		字符串
@return bool

func MkdirPathIfNotExist

func MkdirPathIfNotExist(dirPath string) error

MkdirPathIfNotExist

@Description:	创建目录
@param dirPath
@return error

func RemoveFile

func RemoveFile(filePath string) error

RemoveFile

@Description: 删除文件
@param filePath
@return error

func RemovePrefix

func RemovePrefix(tableName string, pre string) string

RemovePrefix

@Description: 移除前缀
@param tableName
@param pre
@return string

func SaveFile

func SaveFile(dirPath, fileName string, text []byte) error

SaveFile

@Description:	保存文件
@param dirPath	路径
@param fileName	文件名
@param text		内容
@return error

func StrToLower

func StrToLower(s string) string

StrToLower

@Description:	转换小写
@param s		字符串
@return string

Types

This section is empty.

Jump to

Keyboard shortcuts

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