Documentation ¶
Index ¶
- type BackendServerDetails
- type BackendServerInfo
- type BackendServerKey
- type ErrInvalidField
- type HAProxyBackend
- type HAProxyConfig
- type HAProxyFrontend
- type HAProxyInboundPort
- type HAProxyServer
- type RoutingKey
- type RoutingTable
- func (table RoutingTable) DeleteBackendServerKey(key RoutingKey, info BackendServerInfo) bool
- func (table RoutingTable) Get(key RoutingKey) RoutingTableEntry
- func (table RoutingTable) PruneEntries(defaultTTL int)
- func (table RoutingTable) Set(key RoutingKey, newEntry RoutingTableEntry) bool
- func (table RoutingTable) Size() int
- func (table RoutingTable) UpsertBackendServerKey(key RoutingKey, info BackendServerInfo) bool
- type RoutingTableEntry
- type SniHostname
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 int UpdatedTime time.Time }
func (BackendServerDetails) DeleteSucceededBy ¶
func (d BackendServerDetails) DeleteSucceededBy(other BackendServerDetails) bool
func (BackendServerDetails) DifferentFrom ¶
func (d BackendServerDetails) DifferentFrom(other BackendServerDetails) bool
Used to determine whether the details have changed such that the routing configuration needs to be updated. e.g max number of connection
func (BackendServerDetails) Expired ¶
func (d BackendServerDetails) Expired(defaultTTL int) bool
func (BackendServerDetails) UpdateSucceededBy ¶
func (d BackendServerDetails) UpdateSucceededBy(other BackendServerDetails) bool
type BackendServerInfo ¶
type BackendServerInfo struct { Address string Port uint16 TLSPort int InstanceID string ModificationTag routing_api_models.ModificationTag TTL int }
type BackendServerKey ¶
type ErrInvalidField ¶
type ErrInvalidField struct { Field string RoutingKey RoutingKey Value interface{} }
func (ErrInvalidField) Error ¶
func (err ErrInvalidField) Error() string
type HAProxyBackend ¶
type HAProxyBackend []HAProxyServer
type HAProxyConfig ¶
type HAProxyConfig map[HAProxyInboundPort]HAProxyFrontend
func NewHAProxyConfig ¶
func NewHAProxyConfig(routingTable RoutingTable, logger lager.Logger) HAProxyConfig
type HAProxyFrontend ¶
type HAProxyFrontend map[SniHostname]HAProxyBackend
func (HAProxyFrontend) ContainsSNIRoutes ¶
func (hf HAProxyFrontend) ContainsSNIRoutes() bool
type HAProxyInboundPort ¶
type HAProxyInboundPort uint16
type HAProxyServer ¶
type HAProxyServer BackendServerKey
type RoutingKey ¶
type RoutingKey struct { Port uint16 SniHostname SniHostname }
func (RoutingKey) String ¶
func (k RoutingKey) String() string
type RoutingTable ¶
type RoutingTable struct { Entries map[RoutingKey]RoutingTableEntry // contains filtered or unexported fields }
func NewRoutingTable ¶
func NewRoutingTable(logger lager.Logger) RoutingTable
func NewRoutingTableWithSession ¶
func NewRoutingTableWithSession(logger lager.Logger, session string) RoutingTable
func (RoutingTable) DeleteBackendServerKey ¶
func (table RoutingTable) DeleteBackendServerKey(key RoutingKey, info BackendServerInfo) bool
Returns true if routing configuration should be modified, false if it should not.
func (RoutingTable) Get ¶
func (table RoutingTable) Get(key RoutingKey) RoutingTableEntry
func (RoutingTable) PruneEntries ¶
func (table RoutingTable) PruneEntries(defaultTTL int)
func (RoutingTable) Set ¶
func (table RoutingTable) Set(key RoutingKey, newEntry RoutingTableEntry) bool
Returns true if routing configuration should be modified, false if it should not.
func (RoutingTable) Size ¶
func (table RoutingTable) Size() int
func (RoutingTable) UpsertBackendServerKey ¶
func (table RoutingTable) UpsertBackendServerKey(key RoutingKey, info BackendServerInfo) bool
Returns true if routing configuration should be modified, false if it should not.
type RoutingTableEntry ¶
type RoutingTableEntry struct {
Backends map[BackendServerKey]BackendServerDetails
}
func NewRoutingTableEntry ¶
func NewRoutingTableEntry(backends []BackendServerInfo) RoutingTableEntry
func (RoutingTableEntry) PruneBackends ¶
func (e RoutingTableEntry) PruneBackends(defaultTTL int, logger lager.Logger)
type SniHostname ¶
type SniHostname string
Click to show internal directories.
Click to hide internal directories.