Documentation
¶
Index ¶
- type BackendRef
- type ControlPlaneRef
- type HTTPRouteRepresentation
- func (t *HTTPRouteRepresentation) AddBackenRefForRule(rName Name, backendRef BackendRef)
- func (t *HTTPRouteRepresentation) AddControlPlaneRef(cpr ControlPlaneRef)
- func (t *HTTPRouteRepresentation) AddHostnames(hostnames Hostnames)
- func (t *HTTPRouteRepresentation) AddMatchForRule(rName Name, match Match)
- func (t *HTTPRouteRepresentation) AddParentRef(parentRef ParentReference)
- func (t *HTTPRouteRepresentation) GetControlPlaneRefByName(name Name) *commonv1alpha1.ControlPlaneRef
- func (t *HTTPRouteRepresentation) GetHostnamesByName(name Name) *Hostnames
- func (t *HTTPRouteRepresentation) GetParentRefByName(name Name) *gwtypes.ParentReference
- type Hostnames
- type Match
- type Name
- type ParentReference
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendRef ¶
type BackendRef struct { Name BackendRef gwtypes.HTTPBackendRef }
BackendRef represents a backend reference within an HTTPRoute rule. It defines the target backend service that should handle requests matching this reference.
type ControlPlaneRef ¶
type ControlPlaneRef struct { Name ControlPlaneRef *commonv1alpha1.ControlPlaneRef }
ControlPlaneRef represents a control plane reference for Kong configuration. It associates Kong entities with their corresponding control plane instance.
type HTTPRouteRepresentation ¶
type HTTPRouteRepresentation struct { Rules map[string]Rule Hostnames map[string]Hostnames ControlPlaneRefs map[string]ControlPlaneRef ParentRefs map[string]ParentReference StripPath bool }
HTTPRouteRepresentation provides an intermediate representation of an HTTPRoute resource. It organizes HTTPRoute data into a structured format that facilitates conversion to Kong entities. This representation includes rules, hostnames, control plane references, parent references, and routing options.
func NewHTTPRouteRepresentation ¶
func NewHTTPRouteRepresentation(route *gwtypes.HTTPRoute) *HTTPRouteRepresentation
NewHTTPRouteRepresentation creates a new HTTPRouteRepresentation from an HTTPRoute resource. It initializes all the internal maps and extracts configuration like strip-path from annotations.
func (*HTTPRouteRepresentation) AddBackenRefForRule ¶
func (t *HTTPRouteRepresentation) AddBackenRefForRule(rName Name, backendRef BackendRef)
AddBackenRefForRule adds a backend reference to a specific rule in the HTTPRoute representation. If the rule doesn't exist, it creates a new rule with the provided name. The backend reference is stored using its name as the key for easy retrieval.
func (*HTTPRouteRepresentation) AddControlPlaneRef ¶
func (t *HTTPRouteRepresentation) AddControlPlaneRef(cpr ControlPlaneRef)
AddControlPlaneRef adds a control plane reference to the HTTPRoute representation. Control plane references associate Kong entities with their corresponding control plane instance.
func (*HTTPRouteRepresentation) AddHostnames ¶
func (t *HTTPRouteRepresentation) AddHostnames(hostnames Hostnames)
AddHostnames adds a hostname to the HTTPRoute representation.
func (*HTTPRouteRepresentation) AddMatchForRule ¶
func (t *HTTPRouteRepresentation) AddMatchForRule(rName Name, match Match)
AddMatchForRule adds a match condition to a specific rule in the HTTPRoute representation. If the rule doesn't exist, it creates a new rule with the provided name. The match is stored using its name as the key for easy retrieval.
func (*HTTPRouteRepresentation) AddParentRef ¶
func (t *HTTPRouteRepresentation) AddParentRef(parentRef ParentReference)
AddParentRef adds a parent reference to the HTTPRoute representation. Parent references define the Gateway or other parent resource that this HTTPRoute is attached to.
func (*HTTPRouteRepresentation) GetControlPlaneRefByName ¶
func (t *HTTPRouteRepresentation) GetControlPlaneRefByName(name Name) *commonv1alpha1.ControlPlaneRef
GetControlPlaneRefByName retrieves a control plane reference by name from the HTTPRoute representation. It normalizes the name by keeping only the parent reference index to ensure proper matching. Returns nil if no control plane reference is found with the given name.
func (*HTTPRouteRepresentation) GetHostnamesByName ¶
func (t *HTTPRouteRepresentation) GetHostnamesByName(name Name) *Hostnames
GetHostnamesByName retrieves hostnames by name from the HTTPRoute representation. Returns nil if no hostnames are found with the given name.
func (*HTTPRouteRepresentation) GetParentRefByName ¶
func (t *HTTPRouteRepresentation) GetParentRefByName(name Name) *gwtypes.ParentReference
GetParentRefByName retrieves a parent reference by name from the HTTPRoute representation. It normalizes the name by keeping only the parent reference index to ensure proper matching. Returns nil if no parent reference is found with the given name.
type Match ¶
type Match struct { Name Match gwtypes.HTTPRouteMatch }
Match represents a single HTTPRoute match condition. It contains the match criteria that determine when a request should be processed by this match.
type Name ¶
type Name struct {
// contains filtered or unexported fields
}
Name represents a structured naming scheme for Kong entities derived from HTTPRoute resources. It provides a hierarchical naming structure with prefix, namespace, name, and optional indexes for parent references, rules, and matches. The String() method ensures names stay within Kubernetes resource name length limits through intelligent truncation.
func NameFromHTTPRoute ¶
NameFromHTTPRoute creates a Name instance from an HTTPRoute resource with optional prefix and indexes. The prefix defaults to "httproute" if empty. Indexes are limited to 3 elements maximum. This function is used to generate consistent names for Kong entities derived from HTTPRoute resources.
func (*Name) GetMatchIndex ¶
GetMatchIndex returns the match index from the indexes array. Returns -1 if the Name is nil or if no match index is available.
func (*Name) GetParentRefIndex ¶
GetParentRefIndex returns the parent reference index from the indexes array. Returns -1 if the Name is nil or if no parent reference index is available.
func (*Name) GetRuleIndex ¶
GetRuleIndex returns the rule index from the indexes array. Returns -1 if the Name is nil or if no rule index is available.
type ParentReference ¶
type ParentReference struct { Name ParentReference gwtypes.ParentReference }
ParentReference represents a parent reference in an HTTPRoute. It defines the Gateway or other parent resource that this HTTPRoute is attached to.