handler

package
v0.0.0-...-e1efe0e Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder implements a handler that logs the raw binary payloads of incoming requests and outgoing responses.

func NewRecorder

func NewRecorder(reqStream, resStream io.Writer, h proxy.RequestHandler) *Recorder

NewRecorder creates a handler that intercepts incoming requests and outgoing responses of an existing RequestHandler and writes them to the specified stream.

func (*Recorder) HandleRequest

func (s *Recorder) HandleRequest(clientID string, w io.Writer, r []byte) error

HandleRequest implements RequestHandler.

func (*Recorder) RemoveClient

func (*Recorder) RemoveClient(string) error

RemoveClient is a no-op for the recorder.

type RemoteMongo

type RemoteMongo struct {
	// contains filtered or unexported fields
}

RemoteMongo acts as a pipe that relays requests/responses between a connected client and a remote mongo server.

func NewRemoteMongoHandler

func NewRemoteMongoHandler(remoteAddr string, tlsConfig *tls.Config) (*RemoteMongo, error)

NewRemoteMongoHandler returns a request handler that connects to a mongod instance at remoteAddr and relays requests/responses. The handler will attempt to establish a TLS connection to the remote server if a non-nil tlsConfig argument is provided.

func (*RemoteMongo) HandleRequest

func (h *RemoteMongo) HandleRequest(_ string, w io.Writer, r []byte) error

HandleRequest implements RequestHandler.

func (*RemoteMongo) RemoveClient

func (*RemoteMongo) RemoveClient(string) error

RemoveClient is a no-op.

Jump to

Keyboard shortcuts

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