Documentation
¶
Overview ¶
Package contract owns the proto projection for Route — a one-way mapping from the typed resolve.ResolvedRouteSpec to the canonical proto RouteSpec used for content-addressable hashing, audit trails, and gRPC API responses.
One-way contract:
resolve.ResolvedRouteSpec → networkscontractv1alpha1.RouteSpec
This projection is NEVER fed back into controllers. It is the canonical serialization of a resolved Route intent — output only.
Runtime wrapper:
RouteSpec.Runtime is *commonv1.RouteRuntime — a common/v1 wrapper message. The local Runtime string is mapped to the wrapper via mapRuntime(). Supported contract values and their canonical mappings: "knative-service" or "knative" → ROUTE_RUNTIME_KNATIVE_SERVICE "kubernetes-container" → ROUTE_RUNTIME_KUBERNETES_CONTAINER "gateway-api" → ROUTE_RUNTIME_GATEWAY_API any other value → ROUTE_RUNTIME_UNSPECIFIED Kourier is Knative's default network layer — both "knative-service" and "knative" map to the same proto enum value.
ServiceUnitRef:
RouteSpec.ServiceUnitRef is *networkscontractv1alpha1.ServiceUnitRef. The local ResolvedServiceUnitRef.Name is projected directly. Nil ref produces a nil proto field — callers treat absence as invalid.
See also:
- resolution/route/resolve — resolution entry point and Runtime type
- resolution/route/adapter — interface wrapper
- pkg/routes/ — application layer consuming ResolvedRoute
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToRouteContract ¶
func ToRouteContract(r *resolve.ResolvedRoute) (*networkscontractv1alpha1.RouteSpec, error)
ToRouteContract projects a ResolvedRoute into the canonical proto RouteSpec for infrastructure consumers (hashing, audit logging, gRPC serialization). Returns nil, nil for a nil input — callers decide whether that is an error.
⚠️ ONE-WAY adapter. The returned value MUST NOT be fed back into any controller or domain logic path.
Types ¶
This section is empty.