Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(r UpdatableRouter) http.Handler
func UpdateRouter ¶
func UpdateRouter(r UpdatableRouter, srv string) error
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) GetHostByKey ¶
type StaticRouter ¶
StaticRouter keeps routing table: which node is responsible for which account
func NewStatic ¶
func NewStatic(self string) *StaticRouter
func (*StaticRouter) GetHostByKey ¶
func (r *StaticRouter) GetHostByKey(key string) string
GetHostByKey returns host for given key. Key is usually accountID
func (*StaticRouter) IsSelf ¶
func (r *StaticRouter) IsSelf(node string) bool
IsSelf checks if current node is equal to given
func (*StaticRouter) Nodes ¶
func (r *StaticRouter) Nodes() []string
func (*StaticRouter) Self ¶
func (r *StaticRouter) Self() string
func (*StaticRouter) SetNodes ¶
func (r *StaticRouter) SetNodes(shardNodes []string)
func (*StaticRouter) SetSelf ¶
func (r *StaticRouter) SetSelf(s string)
Click to show internal directories.
Click to hide internal directories.