Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
Interceptor is a MongoDB wire-protocol proxy. It sits between the service under test and a real MongoDB container. For each OP_MSG command it checks the mock registry; if a mock is found it synthesises a BSON response, otherwise the bytes are forwarded to the real upstream.
func NewInterceptor ¶
func NewInterceptor(addr, upstreamAddr string, reg *registry.MockRegistry) *Interceptor
NewInterceptor creates a new MongoDB interceptor.
func (*Interceptor) SetResolver ¶
func (p *Interceptor) SetResolver(resolver *interpolate.Resolver)
SetResolver wires an interpolate.Resolver into the payload loader so that ${VAR} tokens in RETURNS payload files are resolved at runtime.
Click to show internal directories.
Click to hide internal directories.