MCPcopy
hub / github.com/netbirdio/netbird / Middleware

Interface Middleware

proxy/internal/middleware/middleware.go:14–36  ·  view source on GitHub ↗

Middleware is the surface exposed by each concrete implementation. The Manager invokes it through the Dispatcher, passing a cloned Input. Each middleware lives in exactly one Slot. Close releases any resources owned by the middleware instance (background goroutines, file handles). It is invoked whe

Source from the content-addressed store, hash-verified

12// must be idempotent and safe to call after construction even when
13// Invoke was never called.
14type Middleware interface {
15 ID() string
16 Version() string
17 Slot() Slot
18
19 // AcceptedContentTypes lists the request/response content types
20 // the middleware needs the body for. Empty slice means the
21 // middleware does not inspect the body.
22 AcceptedContentTypes() []string
23
24 // MetadataKeys is the closed set of metadata keys this middleware
25 // may emit. The accumulator drops anything outside this allowlist.
26 MetadataKeys() []string
27
28 // MutationsSupported reports whether the middleware may emit
29 // header / body mutations. A spec with CanMutate=true is honoured
30 // only when the implementation also supports mutations.
31 MutationsSupported() bool
32
33 Invoke(ctx context.Context, in *Input) (*Output, error)
34
35 Close() error
36}
37
38// Factory builds a configured Middleware instance from raw config
39// bytes shipped on the wire. Each registered middleware ID has a

Callers 116

ResolveMethod · 0.65
TestMiddlewareIdentityFunction · 0.65
TestMiddlewareIdentityFunction · 0.65
TestMiddlewareIdentityFunction · 0.65
handleRuntimeMethod · 0.65
ResolveMethod · 0.65
TestMiddlewareIdentityFunction · 0.65

Implementers 10

stubMiddlewareproxy/middleware_translate_test.go
fakeMiddlewareproxy/internal/middleware/chain_test.g
middlewareImplproxy/internal/middleware/builtin/llm_
Middlewareproxy/internal/middleware/builtin/llm_
Middlewareproxy/internal/middleware/builtin/llm_
Middlewareproxy/internal/middleware/builtin/llm_
Middlewareproxy/internal/middleware/builtin/llm_
Middlewareproxy/internal/middleware/builtin/cost
Middlewareproxy/internal/middleware/builtin/llm_
Middlewareproxy/internal/middleware/builtin/llm_

Calls

no outgoing calls

Tested by

no test coverage detected