Documentation ¶
Index ¶
- Constants
- func Cache(alias string) internal.Cacher
- func Consumer(alias string) queue.Consumer
- func DB(alias string) *gorm.DB
- func Destroy() error
- func Init(opts ...option) error
- func MgoShareClone(alias string) *mgo.Session
- func MgoShareCopy(alias string) *mgo.Session
- func NewId() string
- func Publisher(alias string) queue.Publisher
- func Redis(alias string) redis_wrapper.RedisWrapper
- func WithDiscoverAddr(addr string) option
- func WithNoStorage() option
- func WithServiceDomain(domain string) option
- type ConfigObject
Constants ¶
View Source
const ( BrokerTypePublisher = "publisher" BrokerTypeConsumer = "consumer" )
Variables ¶
This section is empty.
Functions ¶
func MgoShareClone ¶
func MgoShareClone(alias string) *mgo.Session
MgoShareClone will return a clone instance of `*mgo.Session`, panic if it's not exists example:
var v = make([]interface{}, 0) s := glib.MgoShareClone("something") defer s.Close() // use it err := s.DB("somedb").C("col").Find(&v)
func MgoShareCopy ¶
func MgoShareCopy(alias string) *mgo.Session
MgoShareCopy will return a copy instance of `*mgo.Session`, panic if it's not exists example:
var v = make([]interface{}, 0) s := glib.MgoShareCopy("something") defer s.Close() // use it err := s.DB("somedb").C("col").Find(&v)
func Redis ¶ added in v1.2.0
func Redis(alias string) redis_wrapper.RedisWrapper
func WithDiscoverAddr ¶
func WithDiscoverAddr(addr string) option
WithDiscoverAddr - config center address
func WithServiceDomain ¶
func WithServiceDomain(domain string) option
WithServiceDomain - set the service's domain used prefix
Types ¶
type ConfigObject ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.