appgw

package
v0.0.0-...-17967aa Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxAllowedHostNames the maximum number of HostNames allowed for listener.
	MaxAllowedHostNames int = 5

	// WildcardSpecialCharacters are characters that are allowed for wildcard HostNames.
	WildcardSpecialCharacters = "*?"
)
View Source
const (
	// DefaultConnDrainTimeoutInSec provides default value for ConnectionDrainTimeout
	DefaultConnDrainTimeoutInSec = 30
)
View Source
const (
	MaxAllowedPriority = 20000
)

Variables

View Source
var DefaultBackendAddressPoolName = fmt.Sprintf("%sdefaultaddresspool", agPrefix)

DefaultBackendAddressPoolName is the name to be assigned to App Gateway's default backend pool resource.

View Source
var DefaultBackendHTTPSettingsName = fmt.Sprintf("%sdefaulthttpsetting", agPrefix)

DefaultBackendHTTPSettingsName is the name to be assigned to App Gateway's default HTTP settings resource.

Functions

func GetVersion

func GetVersion() string

GetVersion returns a string representing the version of AGIC.

func IsMutliSiteListener

func IsMutliSiteListener(listener *n.ApplicationGatewayHTTPListener) bool

func LookupIPConfigurationByID

func LookupIPConfigurationByID(frontendIPConfigurations *[]n.ApplicationGatewayFrontendIPConfiguration, ID *string) *n.ApplicationGatewayFrontendIPConfiguration

LookupIPConfigurationByID gets by ID.

func LookupIPConfigurationByType

func LookupIPConfigurationByType(frontendIPConfigurations *[]n.ApplicationGatewayFrontendIPConfiguration, frontendType FrontendType) *n.ApplicationGatewayFrontendIPConfiguration

LookupIPConfigurationByType gets the public or private address depending upon privateIP parameter.

func LookupListenerByID

func LookupListenerByID(listeners *[]n.ApplicationGatewayHTTPListener, ID *string) *n.ApplicationGatewayHTTPListener

LookupListener gets by ID.

func NewAppGwyConfigFixture

func NewAppGwyConfigFixture() *n.ApplicationGatewayPropertiesFormat

NewAppGwyConfigFixture creates a new struct for testing.

func NewPrivateIPFrontendIPConfiguration

func NewPrivateIPFrontendIPConfiguration() n.ApplicationGatewayFrontendIPConfiguration

func NewPublicIPFrontendIPConfiguration

func NewPublicIPFrontendIPConfiguration() n.ApplicationGatewayFrontendIPConfiguration

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock is an interface, which allows you to implement your own Time.

type ConfigBuilder

type ConfigBuilder interface {
	PreBuildValidate(cbCtx *ConfigBuilderContext) error
	Build(cbCtx *ConfigBuilderContext) (*n.ApplicationGateway, error)
	PostBuildValidate(cbCtx *ConfigBuilderContext) error
}

ConfigBuilder is a builder for application gateway configuration

func NewConfigBuilder

func NewConfigBuilder(context *k8scontext.Context, appGwIdentifier *Identifier, original *n.ApplicationGateway, recorder record.EventRecorder, clock Clock) ConfigBuilder

NewConfigBuilder construct a builder

type ConfigBuilderContext

type ConfigBuilderContext struct {
	IngressList          []*networking.Ingress
	ServiceList          []*v1.Service
	ProhibitedTargets    []*ptv1.AzureIngressProhibitedTarget
	EnvVariables         environment.EnvVariables
	IstioGateways        []*v1alpha3.Gateway
	IstioVirtualServices []*v1alpha3.VirtualService

	DefaultAddressPoolID  *string
	DefaultHTTPSettingsID *string

	ExistingPortsByNumber map[Port]n.ApplicationGatewayFrontendPort
}

ConfigBuilderContext holds the structs we have fetches from Kubernetes + environment, based on which we will construct App Gateway config.

func (*ConfigBuilderContext) InIngressList

func (cbCtx *ConfigBuilderContext) InIngressList(ingress *networking.Ingress) bool

InIngressList returns true if an ingress is in the ingress list

type FrontendType

type FrontendType string
const (
	// FrontendTypePublic is a public IP address
	FrontendTypePublic FrontendType = "Public"

	// FrontendTypePrivate is a private IP address
	FrontendTypePrivate FrontendType = "Private"
)

func DetermineFrontendType

func DetermineFrontendType(frontendIPConfiguration *n.ApplicationGatewayFrontendIPConfiguration) FrontendType

DetermineFrontendType determines whether frontend is public or private.

type Identifier

type Identifier struct {
	SubscriptionID string
	ResourceGroup  string
	AppGwName      string
}

Identifier is identifier for a specific Application Gateway

func (Identifier) AddressPoolID

func (agw Identifier) AddressPoolID(poolName string) string

AddressPoolID generates an ID for a backend address pool.

func (Identifier) HTTPSettingsID

func (agw Identifier) HTTPSettingsID(settingsName string) string

HTTPSettingsID generates an ID for App Gateway HTTP settings resource.

type Port

type Port int32

Port is a type alias for int32, representing a port number.

Jump to

Keyboard shortcuts

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