clientconn

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Listener

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

Listener main data object.

func NewListener

func NewListener(opts *NewListenerOpts) *Listener

NewListener returns a new listener, configured by the NewListenerOpts argument.

func (*Listener) Run

func (l *Listener) Run(ctx context.Context) error

Run the listener, accepting connections.

type Mode

type Mode string
const (
	// NormalMode only handles requests.
	NormalMode Mode = "normal"
	// ProxyMode only proxies requests to another wire protocol compatible service.
	ProxyMode Mode = "proxy"
	// DiffNormalMode both handles requests and proxies them, then logs the diff.
	// Only the FerretDB response is sent to the client.
	DiffNormalMode Mode = "diff-normal"
	// DiffProxyMode both handles requests and proxies them, then logs the diff.
	// Only the proxy response is sent to the client.
	DiffProxyMode Mode = "diff-proxy"
)

type NewListenerOpts

type NewListenerOpts struct {
	ListenAddr string
	TLS        bool
	ProxyAddr  string
	Mode       Mode
	PgPool     *pg.Pool
	Logger     *zap.Logger

	TestConnTimeout time.Duration
}

NewListenerOpts, configuration for a listener.

Jump to

Keyboard shortcuts

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