routingtable

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

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

type BackendServerKey struct {
	Address string
	Port    uint16
}

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

type RoutingTable struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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