module

package
v0.0.0-...-71d5ba4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogModule

type LogModule interface {
	Module
	DefaultLogger() log.Logger
	Logger(name string) log.Logger
}

log module

func NewLogModule

func NewLogModule(loggers Loggers) LogModule

type Loggers

type Loggers map[string]log.Logger

type Module

type Module interface {
	Close()
}

type MongoDB

type MongoDB interface {
	Session() *mgo.Session
	Create(model interface{})
	CreateMany(models interface{})
	FindAll(models interface{})
	FindMany(bson bson.M, models interface{})
	Find(bson bson.M, model interface{})
	Close()
}

func NewMongoDB

func NewMongoDB(addr, username, pwd, defaultDb string) MongoDB

type MongoModule

type MongoModule interface {
	Module
	DefaultDB() MongoDB
	DB(name string) MongoDB
}

mongo

func NewMongoModule

func NewMongoModule(dbs map[string]MongoDB) MongoModule

type MySqlDB

type MySqlDB interface {
	OrmDB() *gorm.DB
	TableName(tbName string) string
	AutoMigrate(model interface{})

	Create(model interface{}) bool
	Find(model interface{}) bool
	FindAll(models interface{}) bool
	FindMany(models interface{}, limit int, orderBy string, whereAndArgs ...interface{}) bool
	Begin() *gorm.DB
	Rollback()
	Commit()
	Close()
}

func NewMysqlDB

func NewMysqlDB(addr, username, pwd, defaultDb, tbPrefix string) MySqlDB

type MySqlModule

type MySqlModule interface {
	Module
	DefaultDB() MySqlDB
	DB(name string) MySqlDB
}

mysql

func NewMysqlModule

func NewMysqlModule(dbs map[string]MySqlDB) MySqlModule

type RPCModule

type RPCModule interface {
	Module
	Call(appName, method string, args interface{}, reply interface{}) error
}

rpc

func NewRPCModule

func NewRPCModule(appName string, rpcClients []*rpc.Client, rpcServer *rpc.Server) RPCModule

type ServiceModule

type ServiceModule interface {
	Module
	GetService(name string) (net.Server, bool)
}

service

func NewServiceModule

func NewServiceModule(servers Services) ServiceModule

type Services

type Services map[string]net.Server

Jump to

Keyboard shortcuts

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