Documentation ¶
Overview ¶
Package clientconn provides client connection implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllModes = []string{ string(NormalMode), string(ProxyMode), string(DiffNormalMode), string(DiffProxyMode), }
AllModes includes all operation modes, with the first one being the default.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct { *NewListenerOpts // contains filtered or unexported fields }
Listener listens on one or multiple interfaces (TCP, Unix, TLS sockets) and accepts incoming client connections.
func NewListener ¶
func NewListener(opts *NewListenerOpts) *Listener
NewListener returns a new listener, configured by the NewListenerOpts argument.
func (*Listener) Collect ¶
func (l *Listener) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Listener) Describe ¶
func (l *Listener) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
func (*Listener) Run ¶
Run runs the listener until ctx is canceled or some unrecoverable error occurs.
When this method returns, listener and all connections, as well as handler are closed.
func (*Listener) TCPAddr ¶
TCPAddr returns TCP listener's address. It can be used to determine an actually used port, if it was zero.
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 { TCP string Unix string TLS string TLSCertFile string TLSKeyFile string TLSCAFile string ProxyAddr string ProxyTLSCertFile string ProxyTLSKeyFile string ProxyTLSCAFile string Mode Mode Metrics *connmetrics.ListenerMetrics Handler *handler.Handler Logger *zap.Logger TestRecordsDir string // if empty, no records are created }
NewListenerOpts represents listener configuration.
Directories ¶
Path | Synopsis |
---|---|
Package conninfo provides access to connection-specific information.
|
Package conninfo provides access to connection-specific information. |
Package connmetrics provides listener and connection metrics.
|
Package connmetrics provides listener and connection metrics. |
Package cursor provides access to cursor registry.
|
Package cursor provides access to cursor registry. |