i2gw

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const GeneratorAnnotationKey = "gateway.networking.k8s.io/generator"

Variables

View Source
var CurrentVersion = "0.4.0"
View Source
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 CastToUnstructured added in v0.4.0

func CastToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)

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, *intermediate.IR) 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

GatewayResources contains all Gateway-API objects and provider Gateway extensions.

func ToGatewayAPIResources

func ToGatewayAPIResources(ctx context.Context, namespace string, inputFile string, providers []string, providerSpecificFlags map[string]map[string]string) ([]GatewayResources, map[string]string, error)

type IRToGatewayAPIConverter added in v0.4.0

type IRToGatewayAPIConverter interface {
	// ToGatewayResources converts stored IR with the Provider into
	// Gateway API resources and extensions
	ToGatewayResources(intermediate.IR) (GatewayResources, field.ErrorList)
}

The IRToGatewayAPIConverter interface specifies conversion functions from IR into Gateway and Gateway extensions.

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

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 ProviderSpecificFlag struct {
	Name         string
	Description  string
	DefaultValue string
}

type ResourcesToIRConverter added in v0.4.0

type ResourcesToIRConverter interface {
	// ToIR converts stored API entities associated with the Provider into IR.
	ToIR() (intermediate.IR, field.ErrorList)
}

The ResourcesToIRConverter interface specifies conversion functions from Ingress and extensions into IR.

Directories

Path Synopsis
providers
gce

Jump to

Keyboard shortcuts

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