version and comment updates

This commit is contained in:
John
2019-02-27 22:17:09 +08:00
parent c2046157d6
commit 86834c5a15
4 changed files with 34 additions and 3 deletions

View File

@ -23,27 +23,36 @@ const (
LOG_LEVEL_CRIT = glog.LEVEL_CRIT
)
// NewVar creates a *Var.
//
// 动态变量
func NewVar(i interface{}, unsafe...bool) *Var {
return gvar.New(i, unsafe...)
}
// Wait blocks until all the web servers shutdown.
//
// 阻塞等待HTTPServer执行完成(同一进程多HTTPServer情况下)
func Wait() {
ghttp.Wait()
}
// Dump dumps a variable to stdout with more manually readable.
//
// 打印变量
func Dump(i...interface{}) {
gutil.Dump(i...)
}
// Throw throws a exception, which can be caught by Catch function.
// It always be used in TryCatch function.
//
// 抛出一个异常
func Throw(exception interface{}) {
gutil.Throw(exception)
}
// try...catch...
// TryCatch does the try...catch... logic.
func TryCatch(try func(), catch ... func(exception interface{})) {
gutil.TryCatch(try, catch...)
}

View File

@ -10,16 +10,22 @@ import (
"github.com/gogf/gf/g/os/glog"
)
// Disable/Enabled debug of logging globally.
//
// 是否显示调试信息
func SetDebug(debug bool) {
glog.SetDebug(debug)
}
// Set the logging level globally.
//
// 设置日志的显示等级
func SetLogLevel(level int) {
glog.SetLevel(level)
}
// Get the global logging level.
//
// 获取设置的日志显示等级
func GetLogLevel() int {
return glog.GetLevel()

View File

@ -17,42 +17,58 @@ import (
"github.com/gogf/gf/g/os/gcfg"
)
// Get an instance of http server with specified name.
//
// HTTPServer单例对象
func Server(name...interface{}) *ghttp.Server {
return ghttp.GetServer(name...)
}
// Get an instance of tcp server with specified name.
//
// TCPServer单例对象
func TCPServer(name...interface{}) *gtcp.Server {
return gtcp.GetServer(name...)
}
// Get an instance of udp server with specified name.
//
// UDPServer单例对象
func UDPServer(name...interface{}) *gudp.Server {
return gudp.GetServer(name...)
}
// Get an instance of template engine object with specified name.
//
// 核心对象View
func View(name...string) *gview.View {
return gins.View(name...)
}
// Config配置管理对象
// Get an instance of config object with specified default config file name.
//
// Config配置管理对象,
// 配置文件目录查找依次为启动参数cfgpath、当前程序运行目录
func Config(file...string) *gcfg.Config {
return gins.Config(file...)
}
// Get an instance of database ORM object with specified configuration group name.
//
// 数据库操作对象,使用了连接池
func Database(name...string) gdb.DB {
return gins.Database(name...)
}
// Alias of Database.
//
// (别名)Database
func DB(name...string) gdb.DB {
return gins.Database(name...)
}
// Get an instance of redis client with specified configuration group name.
//
// Redis操作对象使用了连接池
func Redis(name...string) *gredis.Redis {
return gins.Redis(name...)

View File

@ -1,5 +1,5 @@
package gf
const VERSION = "v1.5.7"
const VERSION = "v1.5.8"
const AUTHORS = "john<john@goframe.org>"