mongodb

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 14 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) 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