全局对象

    常用数据类型别名。

    1. // 泛型
    2. type Var = gvar.Var
    3. // 常用Map类型
    4. type Map = map[string]interface{}
    5. type MapAnyAny = map[interface{}]interface{}
    6. type MapAnyInt = map[interface{}]int
    7. type MapStrAny = map[string]interface{}
    8. type MapStrStr = map[string]string
    9. type MapStrInt = map[string]int
    10. type MapIntAny = map[int]interface{}
    11. type MapIntStr = map[int]string
    12. // 常用Slice Map类型
    13. type List = []Map
    14. type ListAnyStr = []map[interface{}]string
    15. type ListAnyInt = []map[interface{}]int
    16. type ListStrAny = []map[string]interface{}
    17. type ListStrStr = []map[string]string
    18. type ListStrInt = []map[string]int
    19. type ListIntAny = []map[int]interface{}
    20. type ListIntStr = []map[int]string
    21. type ListIntInt = []map[int]int
    22. // 常用Slice类型
    23. type Slice = []interface{}
    24. type SliceAny = []interface{}
    25. type SliceInt = []int
    26. // 常用Slice类型(别名)
    27. type Array = []interface{}
    28. type ArrayAny = []interface{}
    29. type ArrayStr = []string
    30. type ArrayInt = []int

    常用对象

    1. func Config(name...string) *gcfg.Config

    别名:

    1. func Cfg(name ...string) *gcfg.Config

    (单例) 日志管理对象

    (单例) 模板引擎对象

    1. func View(name ...string) *gview.View
    1. func Server(name ...interface{}) *ghttp.Server

    (单例) TCP Server

    1. func TcpServer(name ...interface{}) *gtcp.Server

    (单例) UDP Server

    1. func DB(name ...string) *gdb.Db

    (单例) Redis客户端对象

    1. func Redis(name ...string) *gredis.Redis

    (单例) 资源管理对象

      1. func I18n(name ...string) *gi18n.Manager