data

package
v0.0.0-...-ccdf126 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: Apache-2.0 Imports: 8 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 {
	DbClusters    map[string]*DbCluster
	RedisClusters map[string]*RedisCluster

	DbMapInitCallback func(dbMap *gorp.DbMap, readonly bool, zone string) error
}

func (*DataSource) GetDb

func (me *DataSource) GetDb(zone string, readonly bool) (*sql.DB, error)

func (*DataSource) GetDbCluster

func (me *DataSource) GetDbCluster(zone string) *DbCluster

func (*DataSource) GetDbMap

func (me *DataSource) GetDbMap(zone string, readonly bool) (*gorp.DbMap, error)

func (*DataSource) GetDefaultRedis

func (me *DataSource) GetDefaultRedis() (redis.Conn, error)

func (*DataSource) GetRedisCluster

func (me *DataSource) GetRedisCluster(zone string) *RedisCluster

type DbCluster

type DbCluster struct {
	Master *DbSetting
	Slave  []*DbSetting
}

type DbSetting

type DbSetting struct {
	DriverName string
	Server     string
	Username   string
	Password   string
	Database   string
	Properties map[string]string
	Engine     string
	Charset    string
	// contains filtered or unexported fields
}

func (*DbSetting) GetDb

func (me *DbSetting) GetDb() (*sql.DB, error)

func (*DbSetting) GetDbConnectionMethods

func (me *DbSetting) GetDbConnectionMethods() (driverName, dataSourceName string)

func (*DbSetting) GetDbMap

func (me *DbSetting) GetDbMap(callback func(dbMap *gorp.DbMap, readonly bool) error, readonly bool) (*gorp.DbMap, error)

type RedisCluster

type RedisCluster struct {
	Servers []*RedisSetting
}

type RedisSetting

type RedisSetting struct {
	Network string
	Address string
	Index   int
}

func (*RedisSetting) GetRedis

func (this *RedisSetting) GetRedis() (redis.Conn, error)

Jump to

Keyboard shortcuts

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