rulerouter

package
v0.0.0-...-e11fe06 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: PostgreSQL Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRules

TODO : unit tests

Types

type RoutePool

type RoutePool interface {
	shard.ShardIterator
	pool.PoolIterator

	MatchRoute(key route.Key,
		beRule *config.BackendRule,
		frRule *config.FrontendRule,
	) (*route.Route, error)

	Obsolete(key route.Key) *route.Route
	Shutdown() error
	NotifyRoutes(func(route *route.Route) error) error
}

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

func (*RoutePoolImpl) Obsolete

func (r *RoutePoolImpl) Obsolete(key route.Key) *route.Route

TODO : unit tests

func (*RoutePoolImpl) Shutdown

func (r *RoutePoolImpl) Shutdown() 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 NewRouter

func NewRouter(tlsconfig *tls.Config, rcfg *config.Router, notifier *notifier.Notifier) *RuleRouterImpl

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) Config

func (r *RuleRouterImpl) Config() *config.Router

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

TODO : unit tests

func (*RuleRouterImpl) Put

func (rr *RuleRouterImpl) Put(id client.Client) error

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

Jump to

Keyboard shortcuts

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