storage

package
v0.0.0-...-f663f0b Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource struct {
	Mysql   *xorm.Engine
	MongoDb *MongoDb
}
var Source *DataSource

type DbConfig

type DbConfig struct {
	DbIp    string
	DbName  string //db name
	DbPort  int    //3306
	DbUser  string //root
	DbPass  string //password
	Charset string //utf8
	Prefix  string //prefix_
	ShowSQL bool   //true则会在控制台打印出生成的SQL语句;
}

func (*DbConfig) Mysql

func (d *DbConfig) Mysql() *xorm.Engine

type MgoConfig

type MgoConfig struct {
	MgoConn       string
	MgoDB         string
	PoolLimit     int
	MinPoolSize   int
	MaxIdleTimeMS int
}

func (*MgoConfig) MongoDb

func (m *MgoConfig) MongoDb() *MongoDb

type MgoDB

type MgoDB interface {
	MongoDb() *MongoDb
}

func NewMongoDBSource

func NewMongoDBSource() MgoDB

type MongoDb

type MongoDb struct {
	Session  *mgo.Session
	Database *mgo.Database
}

func (*MongoDb) InsetAll

func (m *MongoDb) InsetAll(table string, pdata ...interface{}) bool

type MySqlDb

type MySqlDb interface {
	Mysql() *xorm.Engine
}

func NewMysqlSource

func NewMysqlSource() MySqlDb

Jump to

Keyboard shortcuts

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