全局对象
常用数据类型别名。
// 泛型
type Var = gvar.Var
// 常用Map类型
type Map = map[string]interface{}
type MapAnyAny = map[interface{}]interface{}
type MapAnyInt = map[interface{}]int
type MapStrAny = map[string]interface{}
type MapStrStr = map[string]string
type MapStrInt = map[string]int
type MapIntAny = map[int]interface{}
type MapIntStr = map[int]string
// 常用Slice Map类型
type List = []Map
type ListAnyStr = []map[interface{}]string
type ListAnyInt = []map[interface{}]int
type ListStrAny = []map[string]interface{}
type ListStrStr = []map[string]string
type ListStrInt = []map[string]int
type ListIntAny = []map[int]interface{}
type ListIntStr = []map[int]string
type ListIntInt = []map[int]int
// 常用Slice类型
type Slice = []interface{}
type SliceAny = []interface{}
type SliceInt = []int
// 常用Slice类型(别名)
type Array = []interface{}
type ArrayAny = []interface{}
type ArrayStr = []string
type ArrayInt = []int
常用对象
func Config(name...string) *gcfg.Config
别名:
func Cfg(name ...string) *gcfg.Config
(单例) 日志管理对象
(单例) 模板引擎对象
func View(name ...string) *gview.View
func Server(name ...interface{}) *ghttp.Server
(单例) TCP Server
func TcpServer(name ...interface{}) *gtcp.Server
(单例) UDP Server
func DB(name ...string) *gdb.Db
(单例) Redis客户端对象
func Redis(name ...string) *gredis.Redis
(单例) 资源管理对象
func I18n(name ...string) *gi18n.Manager