clientconn

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package clientconn provides client connection implementation.

Index

Constants

This section is empty.

Variables

AllModes includes all operation modes, with the first one being the default.

Functions

This section is empty.

Types

type ConnMetrics added in v0.2.1

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

ConnMetrics represents conn metrics.

func (*ConnMetrics) Collect added in v0.2.1

func (cm *ConnMetrics) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*ConnMetrics) Describe added in v0.2.1

func (cm *ConnMetrics) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

type Listener

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

Listener accepts incoming client connections.

func NewListener

func NewListener(opts *NewListenerOpts) *Listener

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

func (*Listener) Addr added in v0.1.0

func (l *Listener) Addr() net.Addr

Addr returns listener's address. It can be used to determine an actually used port, if it was zero.

func (*Listener) Collect added in v0.0.6

func (l *Listener) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*Listener) Describe added in v0.0.6

func (l *Listener) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

func (*Listener) Run

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

Run runs the listener until ctx is canceled or some unrecoverable error occurs.

type ListenerMetrics added in v0.0.5

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

ListenerMetrics represents listener metrics.

func (*ListenerMetrics) Collect added in v0.0.5

func (lm *ListenerMetrics) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*ListenerMetrics) Describe added in v0.0.5

func (lm *ListenerMetrics) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

type Mode

type Mode string

Mode represents FerretDB mode of operation.

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
	ProxyAddr       string
	Mode            Mode
	Handler         handlers.Interface
	Logger          *zap.Logger
	TestConnTimeout time.Duration
	StartTime       time.Time
}

NewListenerOpts represents listener configuration.

Jump to

Keyboard shortcuts

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