dataplane

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package dataplane is the function-invocation data plane (ADR-0033): the HTTP handler that serves function traffic, separate from the control-plane API (ADR-0028).

Front door (ADR-0110, F79): it first consults the edge Router — a compiled Route matcher — to resolve a request to a (namespace, function). On a hit it runs the existing activator hop (it resolves, it does not proxy — scale-to-zero is preserved). On a miss it falls back to the path form /function/<name> (+ X-Funcd-Namespace, default "default"): if the target namespace is `explicit` the request is 404ed BEFORE any activator call (default-deny ingress, no wake); otherwise it is served by name exactly as before. Internal fn-to-fn invoke (ADR-0064) reuses this same in-process handler but marks its context WithInternal, which bypasses the Route front door and the exposure gate — internal invocation is by name and is never gated (spoof-proof: the marker is a context value set in-process, unreachable from the public listener).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(st store.Store, act *activator.Activator, rtr router.Router, enf *authn.Enforcer, stat *static.Handler, logger *slog.Logger) http.Handler

Handler builds the data-plane HTTP handler. The activator is the sole serving path; gateway.Handler() is not mounted here (ADR-0033). rtr is the F79 edge router (may be nil, in which case only the /function/<name> path is served — implicit-only, pre-F79 behavior). enf is the F77 edge authn PEP (may be nil ⇒ no enforcement for `open`; an `authenticated` stance fails closed). stat is the F82 static-asset handler (may be nil ⇒ a static Route match 404s).

func InvokeEnvelope added in v0.2.1

func InvokeEnvelope(ns v1.NamespaceName, name v1.ObjectName, body []byte) []byte

InvokeEnvelope returns body as the CloudEvents v1.0 envelope for an invoke of ns/name under the ADR-0134 rule, or body unchanged when it is not valid JSON. The edge normalizes only external traffic, so an internal producer (the fn-to-fn broker, ADR-0064) uses this to emit its envelope.

func WithInternal

func WithInternal(ctx context.Context) context.Context

WithInternal marks ctx as an internal (fn-to-fn, ADR-0064) invocation so the exposure gate is bypassed — internal invocation is never gated by a namespace's exposure mode (ADR-0110). It is a context value set only in-process by the worker-node local API broker; an external request on the public listener gets a fresh context and can never spoof it.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves function-invocation traffic through the activator.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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