Documentation ¶
Index ¶
- func ParseRules(rcfg *config.Router) (map[route.Key]*config.FrontendRule, map[route.Key]*config.BackendRule, ...)
- type RoutePool
- type RoutePoolImpl
- func (r *RoutePoolImpl) ForEach(cb func(sh shard.Shardinfo) error) error
- func (r *RoutePoolImpl) ForEachPool(cb func(pool.Pool) error) error
- func (r *RoutePoolImpl) MatchRoute(key route.Key, beRule *config.BackendRule, frRule *config.FrontendRule) (*route.Route, error)
- func (r *RoutePoolImpl) NotifyRoutes(cb func(route *route.Route) error) error
- func (r *RoutePoolImpl) Obsolete(key route.Key) *route.Route
- func (r *RoutePoolImpl) Shutdown() error
- type RuleRouter
- type RuleRouterImpl
- func (r *RuleRouterImpl) AddClient(cl rclient.RouterClient)
- func (r *RuleRouterImpl) CancelClient(csm *pgproto3.CancelRequest) error
- func (rr *RuleRouterImpl) ClientPoolForeach(cb func(client client.ClientInfo) error) error
- func (r *RuleRouterImpl) Config() *config.Router
- func (r *RuleRouterImpl) ForEach(cb func(sh shard.Shardinfo) error) error
- func (rr *RuleRouterImpl) ForEachPool(cb func(pool.Pool) error) error
- func (rr *RuleRouterImpl) Pop(clientID uint) (bool, error)
- func (r *RuleRouterImpl) PreRoute(conn net.Conn, pt port.RouterPortType) (rclient.RouterClient, error)
- func (rr *RuleRouterImpl) Put(id client.Client) error
- func (r *RuleRouterImpl) ReleaseClient(cl rclient.RouterClient)
- func (r *RuleRouterImpl) Reload(configPath string) error
- func (r *RuleRouterImpl) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRules ¶
func ParseRules(rcfg *config.Router) (map[route.Key]*config.FrontendRule, map[route.Key]*config.BackendRule, *config.FrontendRule, *config.BackendRule)
TODO : unit tests
Types ¶
type RoutePoolImpl ¶
type RoutePoolImpl struct {
// contains filtered or unexported fields
}
func NewRouterPoolImpl ¶
func NewRouterPoolImpl(shardMapping map[string]*config.Shard) *RoutePoolImpl
func (*RoutePoolImpl) ForEach ¶
func (r *RoutePoolImpl) ForEach(cb func(sh shard.Shardinfo) error) error
TODO : unit tests
func (*RoutePoolImpl) ForEachPool ¶
func (r *RoutePoolImpl) ForEachPool(cb func(pool.Pool) error) error
TODO : unit tests
func (*RoutePoolImpl) MatchRoute ¶
func (r *RoutePoolImpl) MatchRoute(key route.Key, beRule *config.BackendRule, frRule *config.FrontendRule) (*route.Route, error)
TODO : unit tests
func (*RoutePoolImpl) NotifyRoutes ¶
func (r *RoutePoolImpl) NotifyRoutes(cb func(route *route.Route) error) error
TODO : unit tests
type RuleRouter ¶
type RuleRouter interface { connectiterator.ConnectIterator Shutdown() error Reload(configPath string) error PreRoute(conn net.Conn, pt port.RouterPortType) (rclient.RouterClient, error) AddClient(cl rclient.RouterClient) CancelClient(csm *pgproto3.CancelRequest) error ReleaseClient(cl rclient.RouterClient) Config() *config.Router }
type RuleRouterImpl ¶
type RuleRouterImpl struct {
// contains filtered or unexported fields
}
func (*RuleRouterImpl) AddClient ¶
func (r *RuleRouterImpl) AddClient(cl rclient.RouterClient)
TODO : unit tests
func (*RuleRouterImpl) CancelClient ¶
func (r *RuleRouterImpl) CancelClient(csm *pgproto3.CancelRequest) error
TODO : unit tests
func (*RuleRouterImpl) ClientPoolForeach ¶
func (rr *RuleRouterImpl) ClientPoolForeach(cb func(client client.ClientInfo) error) error
TODO : unit tests
func (*RuleRouterImpl) ForEach ¶
func (r *RuleRouterImpl) ForEach(cb func(sh shard.Shardinfo) error) error
func (*RuleRouterImpl) ForEachPool ¶
func (rr *RuleRouterImpl) ForEachPool(cb func(pool.Pool) error) error
func (*RuleRouterImpl) Pop ¶
func (rr *RuleRouterImpl) Pop(clientID uint) (bool, error)
TODO : unit tests
func (*RuleRouterImpl) PreRoute ¶
func (r *RuleRouterImpl) PreRoute(conn net.Conn, pt port.RouterPortType) (rclient.RouterClient, error)
TODO : unit tests
func (*RuleRouterImpl) ReleaseClient ¶
func (r *RuleRouterImpl) ReleaseClient(cl rclient.RouterClient)
TODO : unit tests
func (*RuleRouterImpl) Reload ¶
func (r *RuleRouterImpl) Reload(configPath string) error
TODO : unit tests
func (*RuleRouterImpl) Shutdown ¶
func (r *RuleRouterImpl) Shutdown() error
Click to show internal directories.
Click to hide internal directories.