clientconn

package
v0.0.0-...-b57e8ac Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

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 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) Run

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

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

type ListenerMetrics

type ListenerMetrics struct {
	ConnectedClients prometheus.Gauge
}

ListenerMetrics represents listener metrics.

func NewListenerMetrics

func NewListenerMetrics() *ListenerMetrics

NewListenerMetrics creates new listener metrics.

func (*ListenerMetrics) Collect

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

Collect implements prometheus.Collector.

func (*ListenerMetrics) Describe

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

Describe implements prometheus.Collector.

type Mode

type Mode string

Mode represents SAP HANA compatibility layer for MongoDB Wire Protocol 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 SAP HANA compatibility layer for MongoDB Wire Protocol 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
	TLSCertFilePath string
	TLSKeyFilePath  string
	TLSCAFilePath   string
	ProxyAddr       string
	Mode            Mode
	HanaPool        *hana.Hpool
	Logger          *zap.Logger
	Metrics         *ListenerMetrics
	HandlersMetrics *handlers.Metrics
	TestConnTimeout time.Duration
}

Jump to

Keyboard shortcuts

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