Documentation
¶
Index ¶
- Constants
- func AddressTypeToMultiCluster(address gatewayapiv1.GatewayAddress) (gatewayapiv1.AddressType, bool)
- func AddressTypeToSingleCluster(address gatewayapiv1.GatewayAddress) (gatewayapiv1.AddressType, bool)
- type GatewayWrapper
- func (g *GatewayWrapper) GetClusterGatewayAddresses() map[string][]gatewayapiv1.GatewayAddress
- func (g *GatewayWrapper) IsMultiCluster() bool
- func (g *GatewayWrapper) ListenerTotalAttachedRoutes(downstreamClusterName string, specListener gatewayapiv1.Listener) int
- func (g *GatewayWrapper) Validate() error
Constants ¶
const ( SingleClusterNameValue = "kudarant.io/single" MultiClusterIPAddressType gatewayapiv1.AddressType = "kuadrant.io/MultiClusterIPAddress" MultiClusterHostnameAddressType gatewayapiv1.AddressType = "kuadrant.io/MultiClusterHostnameAddress" )
Variables ¶
This section is empty.
Functions ¶
func AddressTypeToMultiCluster ¶
func AddressTypeToMultiCluster(address gatewayapiv1.GatewayAddress) (gatewayapiv1.AddressType, bool)
AddressTypeToMultiCluster returns a multi cluster version of the address type and a bool to indicate that provided address type was converted. If not - original type is returned
func AddressTypeToSingleCluster ¶
func AddressTypeToSingleCluster(address gatewayapiv1.GatewayAddress) (gatewayapiv1.AddressType, bool)
AddressTypeToSingleCluster converts provided multicluster address to single cluster version the bool indicates a successful conversion
Types ¶
type GatewayWrapper ¶
type GatewayWrapper struct {
*gatewayapiv1.Gateway
}
func NewGatewayWrapper ¶
func NewGatewayWrapper(g *gatewayapiv1.Gateway) *GatewayWrapper
func (*GatewayWrapper) GetClusterGatewayAddresses ¶
func (g *GatewayWrapper) GetClusterGatewayAddresses() map[string][]gatewayapiv1.GatewayAddress
GetClusterGatewayAddresses constructs a map from Status.Addresses of underlying Gateway with key being a cluster and value being an address in the cluster. In case of a single-cluster Gateway the key is SingleClusterNameValue
func (*GatewayWrapper) IsMultiCluster ¶
func (g *GatewayWrapper) IsMultiCluster() bool
IsMultiCluster reports a type of the first address in the Status block returns false if no addresses present
func (*GatewayWrapper) ListenerTotalAttachedRoutes ¶
func (g *GatewayWrapper) ListenerTotalAttachedRoutes(downstreamClusterName string, specListener gatewayapiv1.Listener) int
ListenerTotalAttachedRoutes returns a count of attached routes from the Status.Listeners for a specified combination of downstreamClusterName and specListener.Name
func (*GatewayWrapper) Validate ¶
func (g *GatewayWrapper) Validate() error
Validate ensures correctly configured underlying Gateway object Returns nil if validation passed