MCPcopy Create free account
hub / github.com/codnect/procyon / routingMiddleware

Struct routingMiddleware

http/middleware.go:32–34  ·  view source on GitHub ↗

routingMiddleware is responsible for matching the incoming request to a registered endpoint. It runs early in the pipeline so that subsequent middleware can inspect the matched endpoint (e.g. for authorization or logging) before it is executed. If a match is found, the endpoint is stored in the con

Source from the content-addressed store, hash-verified

30// ctx.SetEndpoint. If no match is found, the context will have
31// a nil endpoint and downstream middleware can decide how to respond.
32type routingMiddleware struct {
33 matcher EndpointMatcher
34}
35
36// newRoutingMiddleware creates a new routingMiddleware with the given
37// EndpointMatcher. This middleware should always be the first in the pipeline.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected