mongodb

package
v3.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 15 Imported by: 0

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.

func (*Interceptor) Start

func (p *Interceptor) Start(ctx context.Context) error

Start begins accepting connections. It blocks until ctx is cancelled.

Jump to

Keyboard shortcuts

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