gins

package
v1.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package gins provides instances management and core components management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

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

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

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

func Get

func Get(key string) interface{}

获取单例对象

func GetOrSet

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

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

func GetOrSetFunc

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

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

func GetOrSetFuncLock

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

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

func Redis

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

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

func Set

func Set(key string, value interface{})

设置单例对象

func SetIfNotExist

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

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

func View

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL