Versions in this module Expand all Collapse all v1 v1.24.3 Apr 25, 2026 Changes in this version + var AllModes = []string + type CommandMetrics struct + Failures map[string]int + Total int + type Handler interface + Handle func(ctx context.Context, req *Request) (resp *Response, err error) + Run func(ctx context.Context) + type Metrics struct + func NewMetrics() *Metrics + func (m *Metrics) Collect(ch chan<- prometheus.Metric) + func (m *Metrics) Describe(ch chan<- *prometheus.Desc) + func (m *Metrics) GetResponses() map[string]map[string]map[string]CommandMetrics + type Middleware struct + func New(opts *NewOpts) *Middleware + func (m *Middleware) Collect(ch chan<- prometheus.Metric) + func (m *Middleware) Describe(ch chan<- *prometheus.Desc) + func (m *Middleware) Handle(ctx context.Context, req *Request) (resp *Response) + func (m *Middleware) Run(ctx context.Context) + type Mode string + const DiffNormalMode + const DiffProxyMode + const NormalMode + const ProxyMode + type NewOpts struct + DocDB Handler + L *slog.Logger + Metrics *Metrics + Mode Mode + Proxy Handler + type Request struct + func RequestDoc(doc wirebson.AnyDocument) (*Request, error) + func RequestWire(header *wire.MsgHeader, body wire.MsgBody) (*Request, error) + func (req *Request) Document() *wirebson.Document + func (req *Request) DocumentDeep() (*wirebson.Document, error) + func (req *Request) DocumentRaw() wirebson.RawDocument + func (req *Request) WireBody() wire.MsgBody + func (req *Request) WireHeader() *wire.MsgHeader + type Response struct + func ResponseDoc(req *Request, doc wirebson.AnyDocument) (*Response, error) + func ResponseErr(req *Request, err *mongoerrors.Error) *Response + func ResponseWire(header *wire.MsgHeader, body wire.MsgBody) (*Response, error) + func (resp *Response) Document() *wirebson.Document + func (resp *Response) DocumentDeep() (*wirebson.Document, error) + func (resp *Response) DocumentRaw() wirebson.RawDocument + func (resp *Response) ErrorCode() mongoerrors.Code + func (resp *Response) ErrorName() string + func (resp *Response) MongoError() *mongoerrors.Error + func (resp *Response) OK() bool + func (resp *Response) WireBody() wire.MsgBody + func (resp *Response) WireHeader() *wire.MsgHeader