Documentation
¶
Overview ¶
Package common includes the common functions shared between enforcer and router callbacks.
Index ¶
- func FindElement[T any](collection []T, predicate func(item T) bool) (T, bool)
- func GetEnvoyListenerName(protocol string, port uint32) string
- func GetEnvoyRouteConfigName(listenerName string, sectionName string) string
- func GetNodeIdentifier(request *discovery.DiscoveryRequest) string
- func MatchesHostname(domain, pattern string) bool
- type NodeQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindElement ¶
FindElement searches for an element in a slice based on a given predicate. It returns the element and true if the element was found.
func GetEnvoyListenerName ¶
GetEnvoyListenerName prepares the envoy listener name based on the protocol and port
func GetEnvoyRouteConfigName ¶
GetEnvoyRouteConfigName prepares Envoy route config name based on Gateway spec's listener name and section name
func GetNodeIdentifier ¶
func GetNodeIdentifier(request *discovery.DiscoveryRequest) string
GetNodeIdentifier constructs the nodeIdentifier from discovery request's node property, label:<instanceIdentifierProperty>
func MatchesHostname ¶
MatchesHostname check whether the domain matches the hostname pattern
Types ¶
type NodeQueue ¶
type NodeQueue struct {
// contains filtered or unexported fields
}
NodeQueue struct is used to keep track of the nodes connected via the XDS.
func GenerateNodeQueue ¶
func GenerateNodeQueue() *NodeQueue
GenerateNodeQueue creates an instance of nodeQueue with a mutex and a string array assigned.