gf: github.com/gogf/gf/g/frame/gins Index | Files

package gins

import "github.com/gogf/gf/g/frame/gins"

Package gins provides instances management and core components management.

Index

Package Files

gins.go

func Config Uses

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

Config returns an instance of View with default settings. The parameter <name> is the name for the instance.

func Database Uses

func Database(name ...string) gdb.DB

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

func Get Uses

func Get(key string) interface{}

获取单例对象

func GetOrSet Uses

func GetOrSet(key string, value interface{}) interface{}

当键名存在时返回其键值,否则写入指定的键值

func GetOrSetFunc Uses

func GetOrSetFunc(key string, f func() interface{}) interface{}

当键名存在时返回其键值,否则写入指定的键值,键值由指定的函数生成

func GetOrSetFuncLock Uses

func GetOrSetFuncLock(key string, f func() interface{}) interface{}

与GetOrSetFunc不同的是,f是在写锁机制内执行

func Redis Uses

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

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

func Set Uses

func Set(key string, value interface{})

设置单例对象

func SetIfNotExist Uses

func SetIfNotExist(key string, value interface{}) bool

当键名不存在时写入,并返回true;否则返回false。

func View Uses

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

View returns an instance of View with default settings. The parameter <name> is the name for the instance.

Package gins imports 12 packages (graph) and is imported by 6 packages. Updated 2019-07-24. Refresh now. Tools for package owners.