Documentation ¶
Overview ¶
Package gins provides instances management and core components management.
Index ¶
- func Config(name ...string) *gcfg.Config
- func Database(name ...string) gdb.DB
- func Get(key string) interface{}
- func GetOrSet(key string, value interface{}) interface{}
- func GetOrSetFunc(key string, f func() interface{}) interface{}
- func GetOrSetFuncLock(key string, f func() interface{}) interface{}
- func I18n(name ...string) *gi18n.Manager
- func Redis(name ...string) *gredis.Redis
- func Resource(name ...string) *gres.Resource
- func Set(key string, value interface{})
- func SetIfNotExist(key string, value interface{}) bool
- func View(name ...string) *gview.View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Config ¶
Config returns an instance of View with default settings. The parameter <name> is the name for the instance.
func Database ¶
Database returns an instance of database ORM object with specified configuration group name.
func GetOrSetFunc ¶
func GetOrSetFunc(key string, f func() interface{}) interface{}
当键名存在时返回其键值,否则写入指定的键值,键值由指定的函数生成
func GetOrSetFuncLock ¶
func GetOrSetFuncLock(key string, f func() interface{}) interface{}
与GetOrSetFunc不同的是,f是在写锁机制内执行
func I18n ¶
I18n returns an instance of gi18n.Manager. The parameter <name> is the name for the instance.
func Redis ¶
Redis returns an instance of redis client with specified configuration group name.
func Resource ¶
Resource returns an instance of Resource. The parameter <name> is the name for the instance.
func SetIfNotExist ¶
当键名不存在时写入,并返回true;否则返回false。
Types ¶
This section is empty.