Documentation
¶
Index ¶
- func ActualLRPData(actualLRP *models.ActualLRP) lager.Data
- func DesiredLRPData(lrp *models.DesiredLRP) lager.Data
- type Address
- type Endpoint
- type EndpointKey
- type ExternalEndpointInfo
- type ExternalEndpointInfos
- type ExternalServiceGreetingMessage
- type InternalRoutableEndpoints
- type InternalRoute
- type MessagesToEmit
- func (m MessagesToEmit) InternalRouteRegistrationCount() uint64
- func (m MessagesToEmit) InternalRouteUnregistrationCount() uint64
- func (m MessagesToEmit) Merge(o MessagesToEmit) MessagesToEmit
- func (m MessagesToEmit) RouteRegistrationCount() uint64
- func (m MessagesToEmit) RouteUnregistrationCount() uint64
- type RegistryMessage
- func InternalAddressRegistryMessageFor(endpoint Endpoint, route Route, emitEndpointUpdatedAt bool) RegistryMessage
- func InternalEndpointRegistryMessageFor(endpoint Endpoint, route InternalRoute, emitEndpointUpdatedAt bool) RegistryMessage
- func RegistryMessageFor(endpoint Endpoint, route Route, emitEndpointUpdatedAt bool) RegistryMessage
- type RoutableEndpoints
- type Route
- type RoutingKey
- type RoutingKeys
- type RoutingTable
- type TCPRouteMappings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DesiredLRPData ¶
func DesiredLRPData(lrp *models.DesiredLRP) lager.Data
Types ¶
type Endpoint ¶
type Endpoint struct {
InstanceGUID string
Index int32
Host string
ContainerIP string
Port uint32
ContainerPort uint32
TlsProxyPort uint32
ContainerTlsProxyPort uint32
Presence models.ActualLRP_Presence
IsolationSegment string
Since int64
ModificationTag *models.ModificationTag
PreferredAddress models.ActualLRPNetInfo_PreferredAddress
AvailabilityZone string
}
func NewEndpoint ¶
func NewEndpoint( instanceGUID string, presence models.ActualLRP_Presence, host, containerIP string, port, containerPort uint32, preferredAddress models.ActualLRPNetInfo_PreferredAddress, modificationTag *models.ModificationTag, availabiltiyZone string, ) Endpoint
func NewEndpointsFromActual ¶
func (Endpoint) IsDirectInstanceRoute ¶
type EndpointKey ¶
func NewEndpointKey ¶
func NewEndpointKey(instanceGUID string, evacuating bool) EndpointKey
func (*EndpointKey) String ¶
func (key *EndpointKey) String() string
type ExternalEndpointInfo ¶
func (ExternalEndpointInfo) Hash ¶
func (info ExternalEndpointInfo) Hash() interface{}
func (ExternalEndpointInfo) MessageFor ¶
func (info ExternalEndpointInfo) MessageFor(e Endpoint, directInstanceRoute, _ bool) (*RegistryMessage, *tcpmodels.TcpRouteMapping, *RegistryMessage)
type ExternalEndpointInfos ¶
type ExternalEndpointInfos []ExternalEndpointInfo
func (ExternalEndpointInfos) ContainsExternalPort ¶
func (e ExternalEndpointInfos) ContainsExternalPort(port uint32) bool
func (ExternalEndpointInfos) HasNoExternalPorts ¶
func (e ExternalEndpointInfos) HasNoExternalPorts(logger lager.Logger) bool
type InternalRoutableEndpoints ¶
type InternalRoutableEndpoints struct {
Routes []InternalRoute
Endpoints map[EndpointKey]Endpoint
DesiredInstances int32
ModificationTag *models.ModificationTag
}
type InternalRoute ¶
func (InternalRoute) Hash ¶
func (r InternalRoute) Hash() interface{}
func (InternalRoute) MessageFor ¶
func (r InternalRoute) MessageFor(endpoint Endpoint, _, emitEndpointUpdatedAt bool) (*RegistryMessage, *tcpmodels.TcpRouteMapping, *RegistryMessage)
type MessagesToEmit ¶
type MessagesToEmit struct {
RegistrationMessages []RegistryMessage
UnregistrationMessages []RegistryMessage
InternalRegistrationMessages []RegistryMessage
InternalUnregistrationMessages []RegistryMessage
}
func (MessagesToEmit) InternalRouteRegistrationCount ¶
func (m MessagesToEmit) InternalRouteRegistrationCount() uint64
func (MessagesToEmit) InternalRouteUnregistrationCount ¶
func (m MessagesToEmit) InternalRouteUnregistrationCount() uint64
func (MessagesToEmit) Merge ¶
func (m MessagesToEmit) Merge(o MessagesToEmit) MessagesToEmit
func (MessagesToEmit) RouteRegistrationCount ¶
func (m MessagesToEmit) RouteRegistrationCount() uint64
func (MessagesToEmit) RouteUnregistrationCount ¶
func (m MessagesToEmit) RouteUnregistrationCount() uint64
type RegistryMessage ¶
type RegistryMessage struct {
Host string `json:"host"`
Port uint32 `json:"port"`
TlsPort uint32 `json:"tls_port,omitempty"`
URIs []string `json:"uris"`
Protocol string `json:"protocol,omitempty"`
App string `json:"app,omitempty" hash:"ignore"`
RouteServiceUrl string `json:"route_service_url,omitempty" hash:"ignore"`
PrivateInstanceId string `json:"private_instance_id,omitempty" hash:"ignore"`
PrivateInstanceIndex string `json:"private_instance_index,omitempty" hash:"ignore"`
ServerCertDomainSAN string `json:"server_cert_domain_san,omitempty" hash:"ignore"`
IsolationSegment string `json:"isolation_segment,omitempty" hash:"ignore"`
EndpointUpdatedAtNs int64 `json:"endpoint_updated_at_ns,omitempty" hash:"ignore"`
Tags map[string]string `json:"tags,omitempty" hash:"ignore"`
AvailabilityZone string `json:"availability_zone,omitempty" hash:"ignore"`
Options json.RawMessage `json:"options,omitempty" hash:"ignore"`
}
func InternalAddressRegistryMessageFor ¶
func InternalAddressRegistryMessageFor(endpoint Endpoint, route Route, emitEndpointUpdatedAt bool) RegistryMessage
This is used when RE is emitting container ip addr/port as opposed to host ip add/port
func InternalEndpointRegistryMessageFor ¶
func InternalEndpointRegistryMessageFor(endpoint Endpoint, route InternalRoute, emitEndpointUpdatedAt bool) RegistryMessage
This is used to generate registry messages for Internal routes
func RegistryMessageFor ¶
func RegistryMessageFor(endpoint Endpoint, route Route, emitEndpointUpdatedAt bool) RegistryMessage
type RoutableEndpoints ¶
type RoutableEndpoints struct {
Domain string
Routes []routeMapping
Endpoints map[EndpointKey]Endpoint
DesiredInstances int32
ModificationTag *models.ModificationTag
}
type Route ¶
type Route struct {
Hostname string
RouteServiceUrl string
IsolationSegment string
LogGUID string
Protocol string
MetricTags map[string]*models.MetricTagValue
Options json.RawMessage
}
func (Route) Hash ¶
func (r Route) Hash() interface{}
route hash is used to find route differences it needs to be dereferenced so that it can be used as a key in a hash map
func (Route) MessageFor ¶
func (r Route) MessageFor(endpoint Endpoint, directInstanceAddress, emitEndpointUpdatedAt bool) (*RegistryMessage, *tcpmodels.TcpRouteMapping, *RegistryMessage)
type RoutingKey ¶
func NewRoutingKey ¶
func NewRoutingKey(processGUID string, containerPort uint32) RoutingKey
type RoutingKeys ¶
type RoutingKeys []RoutingKey
func NewRoutingKeysFromActual ¶
func NewRoutingKeysFromActual(actualLRP *models.ActualLRP) RoutingKeys
func NewRoutingKeysFromDesired ¶
func NewRoutingKeysFromDesired(desired *models.DesiredLRP) RoutingKeys
func (RoutingKeys) Remove ¶
func (lhs RoutingKeys) Remove(rhs RoutingKeys) RoutingKeys
type RoutingTable ¶
type RoutingTable interface {
// table modification
SetRoutes(logger lager.Logger, beforeLRP, afterLRP *models.DesiredLRP) (TCPRouteMappings, MessagesToEmit)
RemoveRoutes(logger lager.Logger, desiredLRP *models.DesiredLRP) (TCPRouteMappings, MessagesToEmit)
AddEndpoint(logger lager.Logger, actualLRP *models.ActualLRP) (TCPRouteMappings, MessagesToEmit)
RemoveEndpoint(logger lager.Logger, actualLRP *models.ActualLRP) (TCPRouteMappings, MessagesToEmit)
Swap(logger lager.Logger, t RoutingTable, domains models.DomainSet) (TCPRouteMappings, MessagesToEmit)
GetInternalRoutingEvents() (TCPRouteMappings, MessagesToEmit)
GetExternalRoutingEvents() (TCPRouteMappings, MessagesToEmit)
HasExternalRoutes(actualLRP *models.ActualLRP) bool
HTTPAssociationsCount() int // return number of associations desired-lrp-http-routes * actual-lrps
InternalAssociationsCount() int // return number of associations desired-lrp-internal-routes * 2 * actual-lrps
TCPAssociationsCount() int // return number of associations desired-lrp-tcp-routes * actual-lrps
TableSize() int
}
func NewRoutingTable ¶
func NewRoutingTable(directInstanceRoute bool, tcpTLSEnabled bool, metronClient loggingclient.IngressClient) RoutingTable
type TCPRouteMappings ¶
type TCPRouteMappings struct {
Registrations []tcpmodels.TcpRouteMapping
Unregistrations []tcpmodels.TcpRouteMapping
}
func (TCPRouteMappings) Merge ¶
func (mappings TCPRouteMappings) Merge(other TCPRouteMappings) TCPRouteMappings
Source Files
¶
Click to show internal directories.
Click to hide internal directories.