kit

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BTool

type BTool struct{}

BTool 工具类

func (BTool) Format

func (BTool) Format(format string, any ...any) string

Format 格式化字符串内容

func (BTool) GetRequestIp

func (BTool) GetRequestIp(req *http.Request) string

GetRequestIp 解析请求中的IP

func (BTool) Int64DefaultValue

func (BTool) Int64DefaultValue(obj int64, def int64) int64

Int64DefaultValue int64位的设置默认值

func (BTool) IntDefaultValue

func (BTool) IntDefaultValue(obj int, def int) int

IntDefaultValue 为整型变量设置初始值

func (BTool) StringDefaultValue

func (BTool) StringDefaultValue(obj string, def string) string

StringDefaultValue 为字符变量设置初始值

func (BTool) StringToInt

func (BTool) StringToInt(obj string) int

StringToInt string类型转为int类型

func (BTool) StringToListBySymbol

func (BTool) StringToListBySymbol(name string, symbol string) []string

StringToListBySymbol 根据分隔符将字符串进行拆分

func (BTool) SubEndSymbol

func (BTool) SubEndSymbol(name string, symbol string) string

SubEndSymbol 截取最后一个指定字符之后的内容

type FileUtils

type FileUtils struct{}

FileUtils 文件操作工具类

func (FileUtils) CreateDir

func (FileUtils) CreateDir(dir string) bool

CreateDir 创建文件夹

func (FileUtils) CreateFile

func (FileUtils) CreateFile(filePath string) (*os.File, error)

CreateFile 创建一个文件

func (FileUtils) GetFileTypeByFileName

func (FileUtils) GetFileTypeByFileName(name string) string

GetFileTypeByFileName 根据文件名称获取到文件的类型

func (FileUtils) GetMd5

func (FileUtils) GetMd5(file *multipart.FileHeader) (string, error)

func (FileUtils) PathIsExist

func (FileUtils) PathIsExist(fileAddr string) bool

PathIsExist 判断文件或路径是否存在

func (FileUtils) SaveFile

func (FileUtils) SaveFile(file *multipart.FileHeader, dst string) error

type Snowflake

type Snowflake struct {
	// contains filtered or unexported fields
}

func (*Snowflake) NewWorker

func (*Snowflake) NewWorker(workerId int64) (*Snowflake, error)

func (*Snowflake) NextId

func (w *Snowflake) NextId() int64

func (*Snowflake) NextIdStr

func (w *Snowflake) NextIdStr() string

type TimeUtils

type TimeUtils struct{}

TimeUtils 时间工具类

func (TimeUtils) GetDay

func (TimeUtils) GetDay() string

GetDay 获取当前的日期

func (TimeUtils) GetDayNoSpec

func (TimeUtils) GetDayNoSpec() string

GetDayNoSpec 获取当前的日期

func (TimeUtils) GetMonth

func (TimeUtils) GetMonth() string

GetMonth 获取当前的月份

func (TimeUtils) GetMonthNoSpec

func (TimeUtils) GetMonthNoSpec() string

GetMonthNoSpec 获取当前的月份

func (TimeUtils) GetTimeNoSpecNow

func (TimeUtils) GetTimeNoSpecNow() string

GetTimeNoSpecNow 获取没有分隔符的当前时间

func (TimeUtils) GetTimeNow

func (TimeUtils) GetTimeNow() string

GetTimeNow 获取当前时间的时间字符串

func (TimeUtils) GetYear

func (TimeUtils) GetYear() string

GetYear 获取当前的年份

Jump to

Keyboard shortcuts

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