router

package
v0.0.0-...-70285c8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2016 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HASHTAG_START = '{'
	HASHTAG_END   = '}'
)
View Source
const (
	RedisPoolMaxIdleNum        = 5
	RedisPoolIdleTimeoutSecond = 2400

	MultiOperatorNum = 128
)
View Source
const (
	DefaultReaderSize = 32 * 1024
	DefaultWiterSize  = 32 * 1024

	RedisConnReaderSize = 16 * 1024
	RedisConnWiterSize  = 16 * 1024

	PipelineResponseNum = 1000
	PipelineRequestNum  = 1000

	EventBusNum         = 1000
	MigrateKeyTimeoutMs = 30 * 1000
	PoolCapability      = 16
)
View Source
const (
	TaskRunnerInNum  = 1000
	TaskRunnerOutNum = 1000
	PipelineBufSize  = 512 * 1024
)

Variables

View Source
var (
	OK_BYTES = []byte("+OK\r\n")
)

Functions

func CheckUlimit

func CheckUlimit(min int)

func GetEventPath

func GetEventPath(evt interface{}) string

func NewTaskRunner

func NewTaskRunner(addr string, netTimeout int, auth string) (*taskRunner, error)

func StringsContain

func StringsContain(s []string, key string) bool

Types

type BufioDeadlineReadWriter

type BufioDeadlineReadWriter interface {
	DeadlineReadWriter
	BufioReader() *bufio.Reader
}

type Conf

type Conf struct {
	ProductName     string
	NetTimeout      int    //seconds
	Proto           string //tcp or tcp4
	CoordinatorAddr string
	Coordinator     string

	Addr     string
	HTTPAddr string
	ProxyID  string
	PidFile  string

	// for client <-> proxy
	ProxyAuth string

	// for proxy <-> server(redis/qdb)
	// if you want to use auth, you must be sure that
	// all the backend servers have the same auth
	StoreAuth string
	// contains filtered or unexported fields
}

func LoadConf

func LoadConf(configFile string) (*Conf, error)

func (*Conf) String

func (c *Conf) String() string

type DeadlineReadWriter

type DeadlineReadWriter interface {
	io.ReadWriter
	SetWriteDeadline(t time.Time) error
	SetReadDeadline(t time.Time) error
}

type MulOp

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

type MultiOperator

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

type PipelineRequest

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

func (*PipelineRequest) String

func (pr *PipelineRequest) String() string

type PipelineResponse

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

type Server

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

func NewServer

func NewServer(conf *Conf) *Server

func (*Server) FillSlots

func (s *Server) FillSlots()

func (*Server) OnGroupChange

func (s *Server) OnGroupChange(groupId int)

func (*Server) OnSlotRangeChange

func (s *Server) OnSlotRangeChange(param *models.SlotMultiSetParam)

func (*Server) RegisterAndWait

func (s *Server) RegisterAndWait(wait bool)

func (*Server) Run

func (s *Server) Run()

type Slot

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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