Documentation ¶
Index ¶
- Variables
- func GetProviderSpecificFlagDefinitions() map[ProviderName]map[string]ProviderSpecificFlag
- func GetSupportedProviders() []string
- func RegisterProviderSpecificFlag(provider ProviderName, flag ProviderSpecificFlag)
- type CustomResourceReader
- type FeatureParser
- type GatewayResources
- type ImplementationSpecificHTTPPathTypeMatchConverter
- type Provider
- type ProviderConf
- type ProviderConstructor
- type ProviderImplementationSpecificOptions
- type ProviderName
- type ProviderSpecificFlag
- type ResourceConverter
Constants ¶
This section is empty.
Variables ¶
var ProviderConstructorByName = map[ProviderName]ProviderConstructor{}
ProviderConstructorByName is a map of ProviderConstructor functions by a provider name. Different Provider implementations should add their construction func at startup.
Functions ¶
func GetProviderSpecificFlagDefinitions ¶ added in v0.3.0
func GetProviderSpecificFlagDefinitions() map[ProviderName]map[string]ProviderSpecificFlag
GetProviderSpecificFlagDefinitions returns the provider specific confs registered by the providers.
func GetSupportedProviders ¶
func GetSupportedProviders() []string
GetSupportedProviders returns the names of all providers that are supported now
func RegisterProviderSpecificFlag ¶ added in v0.3.0
func RegisterProviderSpecificFlag(provider ProviderName, flag ProviderSpecificFlag)
RegisterProviderSpecificFlag registers a provider-specific flag. Each provider-specific flag is exposed to the user as an optional command-line flag --<provider>-<flag>. If the flag is not provided, it is up to the provider to decide to use the default value or raise an error. The provider can read the values of provider-specific flags input by the user from the ProviderConf. RegisterProviderSpecificFlag is thread-safe.
Types ¶
type CustomResourceReader ¶
type CustomResourceReader interface { // ReadResourcesFromCluster reads custom resources associated with // the underlying Provider implementation from the kubernetes cluster. ReadResourcesFromCluster(ctx context.Context) error // ReadResourcesFromFile reads custom resources associated with // the underlying Provider implementation from the file. ReadResourcesFromFile(ctx context.Context, filename string) error }
type FeatureParser ¶
type FeatureParser func([]networkingv1.Ingress, *GatewayResources) field.ErrorList
FeatureParser is a function that reads the Ingresses, and applies the appropriate modifications to the GatewayResources.
Different FeatureParsers will run in undetermined order. The function must modify / create only the required fields of the gateway resources and nothing else.
type GatewayResources ¶
type GatewayResources struct { Gateways map[types.NamespacedName]gatewayv1.Gateway GatewayClasses map[types.NamespacedName]gatewayv1.GatewayClass HTTPRoutes map[types.NamespacedName]gatewayv1.HTTPRoute TLSRoutes map[types.NamespacedName]gatewayv1alpha2.TLSRoute TCPRoutes map[types.NamespacedName]gatewayv1alpha2.TCPRoute UDPRoutes map[types.NamespacedName]gatewayv1alpha2.UDPRoute ReferenceGrants map[types.NamespacedName]gatewayv1beta1.ReferenceGrant }
GatewayResources contains all Gateway-API objects.
func MergeGatewayResources ¶ added in v0.3.0
func MergeGatewayResources(gatewayResources ...GatewayResources) (GatewayResources, field.ErrorList)
MergeGatewayResources accept multiple GatewayResources and create a unique Resource struct built as follows:
- GatewayClasses, *Routes, and ReferenceGrants are grouped into the same maps
- Gateways may have the same NamespaceName even if they come from different ingresses, as they have a their GatewayClass' name as name. For this reason, if there are mutiple gateways named the same, their listeners are merged into a unique Gateway.
This behavior is likely to change after https://github.com/kubernetes-sigs/gateway-api/pull/1863 takes place.
type ImplementationSpecificHTTPPathTypeMatchConverter ¶ added in v0.2.0
type ImplementationSpecificHTTPPathTypeMatchConverter func(*gatewayv1.HTTPPathMatch)
ImplementationSpecificHTTPPathTypeMatchConverter is an option to customize the ingress implementationSpecific match type conversion.
type Provider ¶
type Provider interface { CustomResourceReader ResourceConverter }
The Provider interface specifies the required functionality which needs to be implemented by every concrete Ingress/Gateway-API provider, in order for it to be used.
type ProviderConf ¶
type ProviderConf struct { Client client.Client Namespace string ProviderSpecificFlags map[string]map[string]string }
ProviderConf contains all the configuration required for every concrete Provider implementation.
type ProviderConstructor ¶
type ProviderConstructor func(conf *ProviderConf) Provider
ProviderConstructor is a construction function that constructs concrete implementations of the Provider interface.
type ProviderImplementationSpecificOptions ¶ added in v0.2.0
type ProviderImplementationSpecificOptions struct {
ToImplementationSpecificHTTPPathTypeMatch ImplementationSpecificHTTPPathTypeMatchConverter
}
ProviderImplementationSpecificOptions contains customized implementation-specific fields and functions. These will be used by the common package to customize the provider-specific behavior for all the implementation-specific fields of the ingress API.
type ProviderName ¶
type ProviderName string
ProviderName is a string alias that stores the concrete Provider name.
type ProviderSpecificFlag ¶ added in v0.3.0
type ResourceConverter ¶
type ResourceConverter interface { // ToGatewayAPIResources converts stored API entities associated // with the Provider into GatewayResources. ToGatewayAPI() (GatewayResources, field.ErrorList) }
The ResourceConverter interface specifies all the implemented Gateway API resource conversion functions.