Documentation
¶
Index ¶
- Constants
- Variables
- type RedisRouting
- func (self RedisRouting) AddRouter(router *model.Router)
- func (self RedisRouting) AddSupport(support *model.Support)
- func (self RedisRouting) Bind(id string, ex string) error
- func (self RedisRouting) BindSession(key string, id string, product int32) error
- func (self RedisRouting) DeleteRouter(router *model.Router) *model.Router
- func (self RedisRouting) DeleteSupport(support *model.Support)
- func (self RedisRouting) GetBackend(msg *p.Message) (string, error)
- func (self RedisRouting) GetRouter(addr string) *model.Router
- func (self RedisRouting) GetRoutingBind(id string) (string, error)
- func (self RedisRouting) GetSessionBackend(product int32) string
- func (self RedisRouting) Unbind(id string) error
- func (self RedisRouting) UnbindSession(key string, id string, product int32) error
- type Routing
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) 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) 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
}
Click to show internal directories.
Click to hide internal directories.