improve validation manager feature for package gvalid

This commit is contained in:
John Guo
2021-05-19 09:25:49 +08:00
parent 0bd1ea07a7
commit ea0340db8e
14 changed files with 352 additions and 344 deletions

View File

@ -18,9 +18,10 @@ import (
"github.com/gogf/gf/os/glog"
"github.com/gogf/gf/os/gres"
"github.com/gogf/gf/os/gview"
"github.com/gogf/gf/util/gvalid"
)
// Client is a convenience function, that creates and returns a new HTTP client.
// Client is a convenience function, which creates and returns a new HTTP client.
func Client() *ghttp.Client {
return ghttp.NewClient()
}
@ -110,3 +111,8 @@ func Model(tableNameOrStruct ...interface{}) *gdb.Model {
func Redis(name ...string) *gredis.Redis {
return gins.Redis(name...)
}
// Validator is a convenience function, which creates and returns a new validation manager object.
func Validator() *gvalid.Validator {
return gvalid.New()
}

View File

@ -11,7 +11,7 @@ import (
"github.com/gogf/gf/net/ghttp"
)
// SetEnabled enables/disables the GoFrame internal logging manually.
// SetDebug enables/disables the GoFrame internal logging manually.
// Note that this function is not concurrent safe, be aware of the DATA RACE,
// which means you should call this function in your boot but not the runtime.
func SetDebug(enabled bool) {