mtools

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateTool = new(DateUtil)

DateTool 时间工具

View Source
var FileTool = new(FileUtils)

FileTool 获取文件处理工具

View Source
var JsonTool = new(JSONUtil)

JsonTool 获取文件处理工具

View Source
var LogStackTool = new(LogStack).filter("go_base")

LogStackTool 只获取当前项目的异常栈

View Source
var StringTool = new(StringUtils)

StringTool 获取文件处理工具

Functions

This section is empty.

Types

type Cache

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

Cache 缓存工具

func (*Cache) Create

func (c *Cache) Create()

Create 创建缓存

func (*Cache) Delete

func (c *Cache) Delete(keys ...string) error

Delete 删除

func (*Cache) Get

func (c *Cache) Get(key string) (string, error)

Get 获取

func (*Cache) Set

func (c *Cache) Set(key string, value string, exTime time.Duration) error

Set 设置

type DateUtil

type DateUtil struct {
}

func (*DateUtil) GetCurrentTime

func (d *DateUtil) GetCurrentTime(format string) (string, error)

GetCurrentTime 获取当前时间

type EmailReq

type EmailReq struct {
	//接收人邮箱
	To string
	//发送人邮箱
	From string

	//发送人密码
	FromPassword string

	//邮箱服务 ip+端口
	Host string

	//邮件表头
	Subject string

	//邮件内容
	Body string
}

EmailReq 邮件信息

type Field

type Field struct {
	TableSchema string
	TableName   string
	ColumnName  string
	DataType    string
}

type FileUtils

type FileUtils struct {
}

func (*FileUtils) ReadBytes

func (f *FileUtils) ReadBytes(fPath string) []byte

ReadBytes 读取文件到内存

type JSONUtil

type JSONUtil struct {
}

func (*JSONUtil) ToObject

func (*JSONUtil) ToObject(str string, obj any) any

ToObject 字符串传json

func (*JSONUtil) ToString

func (*JSONUtil) ToString(obj any) string

ToString 对象转json

type LogStack

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

LogStack 日志异常栈

func (*LogStack) Stack

func (s *LogStack) Stack(msg string) []string

Stack 错误栈信息组装

type Mail

type Mail struct {
}

Mail 邮件服务

func (*Mail) SendMail

func (m *Mail) SendMail(emailReq EmailReq) error

SendMail 发送邮件

type StringUtils

type StringUtils struct {
}

func (*StringUtils) Contain

func (s *StringUtils) Contain(str string, substr string) bool

Contain 是否包含字符串

func (*StringUtils) CreateUUID

func (s *StringUtils) CreateUUID() string

CreateUUID 创建uuid

func (*StringUtils) Eq

func (s *StringUtils) Eq(str1 string, str2 string) bool

Eq 判断相等

func (*StringUtils) HumpToUnderLine

func (s *StringUtils) HumpToUnderLine(str string) string

HumpToUnderLine 下划线转驼峰

func (*StringUtils) IsBlank

func (s *StringUtils) IsBlank(str string) bool

IsBlank 判断为空(去掉空格之后)

func (*StringUtils) IsEmpty

func (s *StringUtils) IsEmpty(str string) bool

IsEmpty 判断为空

func (*StringUtils) IsNotBlank

func (s *StringUtils) IsNotBlank(str string) bool

IsNotBlank 判断不为空(去掉空格之后)

func (*StringUtils) IsNotEmpty

func (s *StringUtils) IsNotEmpty(str string) bool

IsNotEmpty 判断不为空

func (*StringUtils) Join

func (s *StringUtils) Join(strs []string, sep string) string

Join 拼接字符串

func (*StringUtils) Len

func (s *StringUtils) Len(str string) int

Len 获取长度

func (*StringUtils) NotEq

func (s *StringUtils) NotEq(str1 string, str2 string) bool

NotEq 判断不相等

func (*StringUtils) ReplaceAll

func (s *StringUtils) ReplaceAll(str string, old string, new string) string

ReplaceAll 是否包含字符串

func (*StringUtils) Split

func (s *StringUtils) Split(str string, sep string) []string

Split 获取长度

func (*StringUtils) UnderLineToHump

func (s *StringUtils) UnderLineToHump(str string, firstToUpper bool) string

UnderLineToHump 驼峰转下划线

Jump to

Keyboard shortcuts

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