models

package
v0.0.0-...-c764716 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 16

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             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
	ModificationTag routing_api_models.ModificationTag
	TTL             int
}

func NewBackendServerInfo

func NewBackendServerInfo(key BackendServerKey, detail BackendServerDetails) BackendServerInfo

type BackendServerKey

type BackendServerKey struct {
	Address string
	Port    uint16
}

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

Jump to

Keyboard shortcuts

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