dbproxy

package
v0.0.0-...-6d7b369 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

simple connection pool

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("no data")

Functions

func HashCRC32

func HashCRC32(s string) uint32
Example
s := "AccountTable"
r1 := HashCRC32(s)
fmt.Println(r1)

r2 := crc32.ChecksumIEEE([]byte(s))
fmt.Println(r2)
Output:

Types

type Config

type Config struct {
	CenterURL string
	Dbproxy   DbproxyConfig
}

type DbproxyConfig

type DbproxyConfig struct {
	Name       string
	DbMod      uint32
	DbURL      []string
	CacheMod   uint32
	CacheURL   []string
	SplitTable []SplitTable
}

type Pool

type Pool struct {
	New func() interface{}
	// contains filtered or unexported fields
}

func NewPool

func NewPool(capcity int, factory func() interface{}) *Pool

func (*Pool) Get

func (p *Pool) Get() interface{}

func (*Pool) Put

func (p *Pool) Put(c io.Closer)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(protocol, addr string) error

type ServiceParams

type ServiceParams struct {
	Name       string
	CacheAddr  string
	DBAddr     string
	SplitTable []SplitTable
}

type SplitTable

type SplitTable struct {
	TableName string
	Hash      string
	Mod       uint32
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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