Documentation
¶
Overview ¶
json 相关处理 User: 青锋真人<[email protected]> Datetime: 2020/5/27 09:57
Package types 时间类型转换 User: 青锋真人<[email protected]> Datetime: 2020/2/8 11:30
Index ¶
- Constants
- func AddSlashes(value interface{}) string
- func Bytes2Str(b []byte) string
- func DateTimeString(args ...interface{}) string
- func DeepFields(ifaceType reflect.Type) []reflect.StructField
- func IsChineseChar(args ...interface{}) bool
- func IsEmail(value interface{}) bool
- func IsEmpty(value interface{}) bool
- func IsFloat(value interface{}) bool
- func IsFloatStr(str string) bool
- func IsIDCard(value string) bool
- func IsIP(args ...interface{}) bool
- func IsInArray(value interface{}, arr []interface{}) bool
- func IsInRange(args ...interface{}) bool
- func IsInSizeRange(args ...interface{}) bool
- func IsIntStr(str string) bool
- func IsInteger(value interface{}) bool
- func IsMatch(value interface{}, regex string) bool
- func IsMobilePhone(value interface{}) bool
- func IsNumberStr(str string) bool
- func IsPrivateIp(ip string) bool
- func IsSecureString(value string) bool
- func IsURL(args ...interface{}) bool
- func Marshal(v interface{}) ([]byte, error)
- func RemoveBbCode(value interface{}) string
- func RemoveHTML(value interface{}) string
- func Required(value interface{}) bool
- func SpecialCharsDecode(value interface{}) string
- func SpecialCharsEncode(value interface{}) string
- func Str2Bytes(s string) []byte
- func StripSlashes(value interface{}) string
- func StructCopy(DstStructPtr interface{}, SrcStructPtr interface{}) error
- func StructValidator(args ...interface{}) error
- func ToDateTime(args ...string) (time.Time, error)
Constants ¶
View Source
const ( //URL相关选项 URL_SCHEME_HTTP = 1 //只允许http URL_SCHEME_HTTPS = 2 //只允许https URL_SCHEME_AUTO = 4 //只允许自动判断协议 //IP相关选项 IP_V4 = 1 //只允许IPv4 IP_V6 = 2 //只允许IPv6 )
Variables ¶
This section is empty.
Functions ¶
func DateTimeString ¶
func DateTimeString(args ...interface{}) string
DateTimeString 格式化显示时间 为空时,默认转换格式为 2020-02-08 11:28:01 只传一个参数,如果是字符串,则表示输出时间格式,时间为当前时间。如果是时间,则表示将该时间转换 2020-02-08 11:44:08 格式 传了两个参数,则第一个为输出格式,第二个为时间
func DeepFields ¶
func DeepFields(ifaceType reflect.Type) []reflect.StructField
func SpecialCharsDecode ¶
func SpecialCharsDecode(value interface{}) string
将specialEntities里面的实体字符转换成specialChars里对应的字符
func SpecialCharsEncode ¶
func SpecialCharsEncode(value interface{}) string
将specialChars转换成对应的specialEntities里对应的实体
func StructCopy ¶
func StructCopy(DstStructPtr interface{}, SrcStructPtr interface{}) error
StructCopy 结构体复制 Example:
src := &Src{"katy", "000"}
var dst Dst
StructCopy(&dst, src)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.