gf: github.com/johng-cn/gf/g Index | Files | Directories

package g

import "github.com/johng-cn/gf/g"

Index

Package Files

g.go g_func.go g_logger.go g_object.go

Constants

const (
    LOG_LEVEL_ALL  = glog.LEVEL_ALL
    LOG_LEVEL_DEBU = glog.LEVEL_DEBU
    LOG_LEVEL_INFO = glog.LEVEL_INFO
    LOG_LEVEL_NOTI = glog.LEVEL_NOTI
    LOG_LEVEL_WARN = glog.LEVEL_WARN
    LOG_LEVEL_ERRO = glog.LEVEL_ERRO
    LOG_LEVEL_CRIT = glog.LEVEL_CRIT
)

func Config Uses

func Config(file ...string) *gcfg.Config

Config配置管理对象 配置文件目录查找依次为:启动参数cfgpath、当前程序运行目录

func DB Uses

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

(别名)Database

func Database Uses

func Database(name ...string) *gdb.Db

数据库操作对象,使用了连接池

func Dump Uses

func Dump(i ...interface{})

打印变量

func GetLogLevel Uses

func GetLogLevel() int

获取设置的日志显示等级

func Redis Uses

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

Redis操作对象,使用了连接池

func Server Uses

func Server(name ...interface{}) *ghttp.Server

HTTPServer单例对象

func SetDebug Uses

func SetDebug(debug bool)

是否显示调试信息

func SetLogLevel Uses

func SetLogLevel(level int)

设置日志的显示等级

func TcpServer Uses

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

TCPServer单例对象

func Throw Uses

func Throw(exception interface{})

抛出一个异常

func TryCatch Uses

func TryCatch(try func(), catch ...func(exception interface{}))

try...catch...

func UdpServer Uses

func UdpServer(name ...interface{}) *gudp.Server

UDPServer单例对象

func View Uses

func View(name ...string) *gview.View

核心对象:View

func Wait Uses

func Wait()

阻塞等待HTTPServer执行完成(同一进程多HTTPServer情况下)

type Array Uses

type Array = Slice

type List Uses

type List = []Map

常用list数据结构(使用别名)

type Map Uses

type Map = map[string]interface{}

常用map数据结构(使用别名)

type Slice Uses

type Slice = []interface{}

常用slice数据结构(使用别名)

type Var Uses

type Var = gvar.Var

框架动态变量,可以用该类型替代interface{}类型

func NewVar Uses

func NewVar(i interface{}, safe ...bool) *Var

动态变量

Directories

PathSynopsis
container
container/garrayPackage garray provides kinds of concurrent-safe(alternative) arrays.
container/gchanPackage gchan provides graceful operations for channel.
container/glistPackage glist provides a concurrent-safe(alternative) doubly linked list.
container/gmapPackage gmap provides kinds of concurrent-safe(alternative) maps.
container/gpoolPackage gpool provides a object-reusable concurrent-safe pool.
container/gqueuePackage gqueue provides a dynamic/static concurrent-safe(alternative) queue.
container/gringPackage gring provides a concurrent-safe(alternative) ring(circular lists).
container/gsetPackage gset provides kinds of concurrent-safe(alternative) sets.
container/gtypePackage gtype provides kinds of concurrent-safe basic-types.
container/gvarPackage gvar provides a universal variable type.
database
database/gdb数据库ORM.
database/gkafkaKafka Client.
database/gredisRedis客户端.
encoding数据编码/解码.
encoding/gbase64BASE64
encoding/gbinary二进制及byte操作
encoding/gcharset字符集转换方法.
encoding/gcompress数据压缩/解压
encoding/ghash常用的hash函数
encoding/ghtmlHTML编码
encoding/gjsonJSON解析/封装.
encoding/gparser数据文件编码/解析.
encoding/gtomlTOML
encoding/gurlURL编码
encoding/gxmlXML
encoding/gyamlYAML
frame常用框架管理.
frame/gins单例对象管理.
frame/gmvcMVC
net
net/ghttpHTTP Client & Server.
net/gipv4IPv4
net/gipv6IPv6
net/gscannerIP扫描器.
net/gsmtpSMTP
net/gtcpTCP服务端
net/gudpUDP
os
os/gcache并发安全的单进程高速缓存.
os/gcfg配置管理.
os/gcmd命令行管理.
os/gcron定时任务.
os/genv环境变量管理
os/gfcache文件缓存.
os/gfile文件管理.
os/gflock文件锁.
os/gfpool文件指针池
os/gfsnotify文件监控.
os/glog日志模块.
os/gmlock内存锁.
os/gproc进程管理/通信.
os/grpoolGoroutine池.
os/gspath搜索目录管理.
os/gtime时间管理
os/gview视图管理.
util
util/gconv类型转换.
util/gpage分页管理.
util/grand随机数管理
util/gregex正则表达式.
util/gstr字符串操作.
util/gutil其他工具包
util/gvalid数据校验.

Package g imports 14 packages (graph). Updated 2018-12-15. Refresh now. Tools for package owners.