config

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GatewayConfigName is the config map name for the gateway configuration.
	GatewayConfigName = "config-gateway"
)

Variables

This section is empty.

Functions

func ToContext

func ToContext(ctx context.Context, c *Config) context.Context

ToContext stores the configuration Config in the passed context.

Types

type Config

type Config struct {
	Network       *networkcfg.Config
	GatewayPlugin *GatewayPlugin
}

Config is the configuration for the route reconciler.

func FromContext

func FromContext(ctx context.Context) *Config

FromContext obtains a Config injected into the passed context.

func FromContextOrDefaults

func FromContextOrDefaults(ctx context.Context) *Config

FromContextOrDefaults is like FromContext, but when no Config is attached it returns a Config populated with the defaults for each of the Config fields.

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Gateway

type Gateway struct {
	types.NamespacedName

	Class             string
	Service           *types.NamespacedName
	SupportedFeatures sets.Set[features.FeatureName]
}

Note deepcopy gen is broken for sets.Set[features.SupportedFeatures] So I've disabled the generator in this package for now

func (*Gateway) DeepCopy

func (in *Gateway) DeepCopy() *Gateway

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway.

func (*Gateway) DeepCopyInto

func (in *Gateway) DeepCopyInto(out *Gateway)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GatewayPlugin added in v0.41.0

type GatewayPlugin struct {
	ExternalGateways []Gateway
	LocalGateways    []Gateway
}

GatewayPlugin specifies which Gateways are used for external/local traffic

func FromConfigMap added in v0.41.0

func FromConfigMap(cm *corev1.ConfigMap) (*GatewayPlugin, error)

FromConfigMap creates a GatewayPlugin config from the supplied ConfigMap

func (*GatewayPlugin) DeepCopy added in v0.41.0

func (in *GatewayPlugin) DeepCopy() *GatewayPlugin

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayPlugin.

func (*GatewayPlugin) DeepCopyInto added in v0.41.0

func (in *GatewayPlugin) DeepCopyInto(out *GatewayPlugin)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GatewayPlugin) ExternalGateway added in v0.41.0

func (g *GatewayPlugin) ExternalGateway() Gateway

func (*GatewayPlugin) LocalGateway added in v0.41.0

func (g *GatewayPlugin) LocalGateway() Gateway

type Store

type Store struct {
	*configmap.UntypedStore
}

Store is a typed wrapper around configmap.Untyped store to handle our configmaps.

+k8s:deepcopy-gen=false

func NewStore

func NewStore(ctx context.Context, onAfterStore ...func(name string, value interface{})) *Store

NewStore creates a configmap.UntypedStore based config store.

logger must be non-nil implementation of configmap.Logger (commonly used loggers conform)

onAfterStore is a variadic list of callbacks to run after the ConfigMap has been processed and stored.

See also: configmap.NewUntypedStore().

func (*Store) Load

func (s *Store) Load() *Config

Load creates a Config for this store.

func (*Store) ToContext

func (s *Store) ToContext(ctx context.Context) context.Context

ToContext stores the configuration Store in the passed context.

Jump to

Keyboard shortcuts

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