Documentation ¶
Index ¶
- type BackendServerDetails
- type BackendServerInfo
- type BackendServerKey
- type RouteTable
- type RoutingKey
- type RoutingTable
- func (table *RoutingTable) BackendExists(key RoutingKey, bk BackendServerKey) bool
- func (table *RoutingTable) DeleteBackendServerKey(key RoutingKey, info BackendServerInfo) bool
- func (table *RoutingTable) NumberOfBackends(key RoutingKey) int
- func (table *RoutingTable) NumberOfRoutes() int
- func (table *RoutingTable) RouteExists(key RoutingKey) bool
- func (table *RoutingTable) StartPruningCycle()
- func (table *RoutingTable) StopPruningCycle()
- func (table *RoutingTable) UpsertBackendServerKey(key RoutingKey, info BackendServerInfo) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendServerDetails ¶
type BackendServerDetails struct { ModificationTag routing_api_models.ModificationTag TTL time.Duration UpdatedTime time.Time }
BackendServerDetails holds version info for that endpoint
type BackendServerInfo ¶
type BackendServerInfo struct { Address string Port uint16 ModificationTag routing_api_models.ModificationTag TTL time.Duration }
BackendServerInfo provides all info needed to create a backend
type BackendServerKey ¶
BackendServerKey is the endpoints info
type RouteTable ¶
type RouteTable interface { UpsertBackendServerKey(key RoutingKey, info BackendServerInfo) bool DeleteBackendServerKey(key RoutingKey, info BackendServerInfo) bool NumberOfRoutes() int NumberOfBackends(key RoutingKey) int }
RouteTable interacts with RoutingTable
type RoutingKey ¶
type RoutingKey struct {
Port uint16
}
RoutingKey is the route port
func (RoutingKey) String ¶
func (k RoutingKey) String() string
type RoutingTable ¶
RoutingTable holds all tcp routing information
func NewRoutingTable ¶
func NewRoutingTable(logger logger.Logger, c *config.Config, listener routeUpdate.Listener) *RoutingTable
NewRoutingTable returns a new RoutingTable
func (*RoutingTable) BackendExists ¶
func (table *RoutingTable) BackendExists(key RoutingKey, bk BackendServerKey) bool
func (*RoutingTable) DeleteBackendServerKey ¶
func (table *RoutingTable) DeleteBackendServerKey(key RoutingKey, info BackendServerInfo) bool
DeleteBackendServerKey returns true if routing configuration should be modified, false if it should not.
func (*RoutingTable) NumberOfBackends ¶
func (table *RoutingTable) NumberOfBackends(key RoutingKey) int
NumberOfBackends returns the number of backends for a particular route
func (*RoutingTable) NumberOfRoutes ¶
func (table *RoutingTable) NumberOfRoutes() int
NumberOfRoutes returns the number of routes
func (*RoutingTable) RouteExists ¶
func (table *RoutingTable) RouteExists(key RoutingKey) bool
func (*RoutingTable) StartPruningCycle ¶
func (table *RoutingTable) StartPruningCycle()
StartPruningCycle kicks off the prune ticker
func (*RoutingTable) StopPruningCycle ¶
func (table *RoutingTable) StopPruningCycle()
StopPruningCycle stops the cycle
func (*RoutingTable) UpsertBackendServerKey ¶
func (table *RoutingTable) UpsertBackendServerKey(key RoutingKey, info BackendServerInfo) bool
UpsertBackendServerKey returns true if routing configuration should be modified, false if it should not.