types

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PolicyConditionEnforced mirrors the internal kuadrant enforced condition
	// type for convenience to extension authors.
	PolicyConditionEnforced = kuadrant.PolicyConditionEnforced
	// KuadrantMetricsPrefix is the prefix applied to metric bindings injected
	// via AddDataTo / KuadrantMetricBinding.
	KuadrantMetricsPrefix = "metrics.labels"
)

Variables

This section is empty.

Functions

func KuadrantMetricBinding

func KuadrantMetricBinding(binding string) string

KuadrantMetricBinding creates a fully qualified binding name for metrics enrichment.

Types

type Domain

type Domain int

Domain enumerates the supported logical domains for mutator injected data.

const (
	// DomainUnspecified indicates no specific domain (default behaviour).
	DomainUnspecified Domain = iota
	// DomainAuth domain for authentication/authorization enrichment.
	DomainAuth
	// DomainRequest domain for request/traffic related enrichment.
	DomainRequest
)

type ExtensionBase

type ExtensionBase struct {
	Logger logr.Logger
	Client client.Client
	Scheme *runtime.Scheme
}

ExtensionBase is a base struct for the extension controllers. ExtensionBase is an embeddable struct providing common fields (logger, client, scheme) and a helper Configure method for extension controllers.

func (*ExtensionBase) Configure

func (eb *ExtensionBase) Configure(ctx context.Context) error

Configure the extension base from the context. Configure populates the base fields (Logger, Client, Scheme) from a context carrying those values.

type KuadrantCtx

type KuadrantCtx interface {
	Resolve(context.Context, Policy, string, bool) (celref.Val, error)
	ResolvePolicy(context.Context, Policy, string, bool) (Policy, error)
	AddDataTo(context.Context, Policy, Domain, string, string) error
	ReconcileObject(context.Context, client.Object, client.Object, MutateFn) (client.Object, error)
}

KuadrantCtx is passed to ReconcileFn providing access to CEL resolution, mutator registration and object reconciliation helpers.

type MutateFn

type MutateFn func(existing, desired client.Object) (bool, error)

MutateFn is a function that mutates the existing object into it's desired state. MutateFn mutates the existing object into the desired state. It returns true when a change was applied requiring an update.

type Policy

type Policy interface {
	GetName() string
	GetNamespace() string
	GetObjectKind() schema.ObjectKind
	GetTargetRefs() []gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName
}

Policy is an interface for the policy object to be implemented by the extension policy. Policy is the common interface a policy object must implement for the extension controller. Implementations are usually thin adapters over generated protobuf or Kubernetes types.

type ReconcileFn

type ReconcileFn func(ctx context.Context, request reconcile.Request, kuadrant KuadrantCtx) (reconcile.Result, error)

ReconcileFn defines the signature of an extension reconcile function.

Jump to

Keyboard shortcuts

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