mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
完善包注释,便于godoc管理
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 二进制及byte操作管理包
|
||||
// 二进制及byte操作
|
||||
package gbinary
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 强大的JSON解析/封装包
|
||||
// JSON解析/封装
|
||||
package gjson
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 全局配置管理对象,配置文件为json文件
|
||||
// 配置管理
|
||||
package gcfg
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// MVC控制器基类
|
||||
// MVC
|
||||
package gmvc
|
||||
|
||||
import (
|
||||
|
||||
@ -4,9 +4,10 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// MVC模型基类
|
||||
|
||||
package gmvc
|
||||
|
||||
// MVC模型基类
|
||||
type Model struct {
|
||||
|
||||
}
|
||||
@ -4,7 +4,6 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// MVC视图基类
|
||||
package gmvc
|
||||
|
||||
import (
|
||||
@ -15,7 +14,7 @@ import (
|
||||
"gitee.com/johng/gf/g/net/ghttp"
|
||||
)
|
||||
|
||||
// 视图对象(一个请求一个视图对象,用完即销毁)
|
||||
// MVC视图基类(一个请求一个视图对象,用完即销毁)
|
||||
type View struct {
|
||||
mu sync.RWMutex // 并发互斥锁
|
||||
view *gview.View // 底层视图对象
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 单进程缓存管理
|
||||
// 单进程缓存
|
||||
package gcache
|
||||
|
||||
import (
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://gitee.com/johng/gf.
|
||||
|
||||
// 文件空间管理, 可用于文件碎片空间维护及再利用,支持自动合并连续碎片空间
|
||||
// 文件空间管理
|
||||
package gfilespace
|
||||
|
||||
import (
|
||||
|
||||
@ -6,6 +6,20 @@
|
||||
|
||||
// 通用数据验证工具
|
||||
// 本来打算取名gvalidator的,名字太长了,缩写一下
|
||||
package gvalid
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"gitee.com/johng/gf/g/os/gtime"
|
||||
"gitee.com/johng/gf/g/net/gipv4"
|
||||
"gitee.com/johng/gf/g/net/gipv6"
|
||||
"gitee.com/johng/gf/g/util/gregx"
|
||||
"gitee.com/johng/gf/g/encoding/gjson"
|
||||
"gitee.com/johng/gf/g/container/gmap"
|
||||
)
|
||||
|
||||
/*
|
||||
参考:https://laravel.com/docs/5.5/validation#available-validation-rules
|
||||
规则如下:
|
||||
@ -50,19 +64,6 @@ in 格式:in:value1,value2,... 说明:参
|
||||
not-in 格式:not-in:value1,value2,... 说明:参数值不应该在value1,value2,...中(字符串匹配)
|
||||
regex 格式:regex:pattern 说明:参数值应当满足正则匹配规则pattern
|
||||
*/
|
||||
package gvalid
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"gitee.com/johng/gf/g/os/gtime"
|
||||
"gitee.com/johng/gf/g/util/gregx"
|
||||
"gitee.com/johng/gf/g/encoding/gjson"
|
||||
"gitee.com/johng/gf/g/container/gmap"
|
||||
"gitee.com/johng/gf/g/net/gipv6"
|
||||
"gitee.com/johng/gf/g/net/gipv4"
|
||||
)
|
||||
|
||||
// 默认规则校验错误消息(可以通过接口自定义错误消息)
|
||||
var defaultMessages = map[string]string {
|
||||
|
||||
Reference in New Issue
Block a user