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

Struct fakeMiddleware

proxy/internal/middleware/chain_test.go:16–29  ·  view source on GitHub ↗

fakeMiddleware is a minimal Middleware for chain composition tests. It records the metadata the dispatcher hands to it and emits a caller-supplied Output. Tests use the recorded snapshot to assert that earlier-in-slot emissions are visible to later middlewares.

Source from the content-addressed store, hash-verified

14// caller-supplied Output. Tests use the recorded snapshot to assert
15// that earlier-in-slot emissions are visible to later middlewares.
16type fakeMiddleware struct {
17 id string
18 slot Slot
19 keys []string
20 emit []KV
21 decision Decision
22 mutationsSupported bool
23 canMutate bool
24 mutations *Mutations
25
26 // seen captures the in.Metadata snapshot the dispatcher passed to
27 // Invoke, so tests can assert ordering and visibility.
28 seen []KV
29}
30
31func (f *fakeMiddleware) ID() string { return f.id }
32func (f *fakeMiddleware) Version() string { return "test" }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected