utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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

Jump to

Keyboard shortcuts

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