def

package
v0.0.0-...-5b025be Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//RegularUserName 用户名
	RegularUserName = "^\\w{5,20}$"
	//RegularPassword 密码
	RegularPassword = "^\\.{5,32}$"
	//RegularIpAddress IP地址
	RegularIpAddress = "^([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}$"
	//RegularIpAddressPort IP:port
	RegularIpAddressPort = "^([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\:([1-6]|)\\d{0,4}$"
	//RegularIpAddressPortOrNot IP:port 或 IP
	RegularIpAddressPortOrNot = "^([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}\\.([1-2]|)\\d{1,2}((\\:([1-6]|)\\d{0,4})|)$"
)

#正则表达式返回,防止重复造轮子#

Variables

View Source
var Validate = validator.New()

Validate 创建校验器

Functions

This section is empty.

Types

type ComRt

type ComRt struct {
	Code      int         `json:"code"`
	Msg       string      `json:"msg"`
	Ret       interface{} `json:"ret,omitempty"`
	Timestamp int64       `json:"timestamp"`
}

ComRt 通用返回值

type SendMailSt

type SendMailSt struct {
	MailTo   []string //收件人
	Subject  string   //标题
	Body     string   //内容
	MailConn struct {
		User   string
		Passwd string
		Host   string
		Port   int
	}
	Alias  string   //别名
	Attach []string //附件
}

Jump to

Keyboard shortcuts

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