bind

package
v0.0.0-...-93dd735 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2016 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	BUCKET_SUPPORT_SIZE = 64
	BIND_PREFIX         = "bind_"
)

Variables

View Source
var (
	ERR_BACKEND_NOT_MATCH = errors.New("backend not match")
	ERR_BIND_NOT_FOUND    = errors.New("bind not found")
)

Functions

This section is empty.

Types

type RedisRouting

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

func (RedisRouting) AddRouter

func (self RedisRouting) AddRouter(router *model.Router)

func (RedisRouting) AddSupport

func (self RedisRouting) AddSupport(support *model.Support)

func (RedisRouting) Bind

func (self RedisRouting) Bind(id string, ex string) error

func (RedisRouting) BindSession

func (self RedisRouting) BindSession(key string, id string, product int32) error

func (RedisRouting) DeleteRouter

func (self RedisRouting) DeleteRouter(router *model.Router) *model.Router

func (RedisRouting) DeleteSupport

func (self RedisRouting) DeleteSupport(support *model.Support)

func (RedisRouting) GetBackend

func (self RedisRouting) GetBackend(msg *p.Message) (string, error)

func (RedisRouting) GetRouter

func (self RedisRouting) GetRouter(addr string) *model.Router

func (RedisRouting) GetRoutingBind

func (self RedisRouting) GetRoutingBind(id string) (string, error)

func (RedisRouting) GetSessionBackend

func (self RedisRouting) GetSessionBackend(product int32) string

func (RedisRouting) Unbind

func (self RedisRouting) Unbind(id string) error

func (RedisRouting) UnbindSession

func (self RedisRouting) UnbindSession(key string, id string, product int32) error

type Routing

type Routing interface {
	Bind(id string, ex string) error
	Unbind(id string) error

	AddSupport(support *model.Support)
	DeleteSupport(support *model.Support) //TODO: remove when backends loop error

	AddRouter(router *model.Router)
	DeleteRouter(router *model.Router) *model.Router
	GetRouter(addr string) *model.Router

	GetRoutingBind(id string) (string, error)

	GetBackend(msg *p.Message) (string, error) //TODO: retry
	GetSessionBackend(product int32) string    //TODO: impl

	BindSession(key string, id string, product int32) error
	UnbindSession(key string, id string, product int32) error
}

func NewRedisRouting

func NewRedisRouting(addr string, pool *redis.Pool, reg registor.Registor, load bool) (Routing, error)

Jump to

Keyboard shortcuts

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