ingress

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Web is the service name for traffic ingressing through a proxy's web listener.
	Web = "web"
	// SSH is the service name for traffic ingressing through a proxy's ssh listener.
	SSH = "ssh"
	// Kube is the service name for traffic ingressing through a proxy's kube listener.
	Kube = "kube"
	// Tunnel is the service name for traffic ingressing through a proxy's reverse tunnel listener.
	Tunnel = "tunnel"
	// MySQL is the service name for traffic ingressing through a proxy's mysql listener.
	MySQL = "mysql"
	// Postgres is the service name for traffic ingressing through a proxy's postgres listener.
	Postgres = "postgres"
	// DatabaseTLS is the service name for traffic ingressing through a proxy's database tls listener.
	DatabaseTLS = "database_tls"
)

Constants for each ingress service.

View Source
const (
	// PathDirect is the ingress path for traffic that is accepted directly by a service listener.
	PathDirect = "direct"
	// PathALPN is the ingress path for traffic that is accepeted by the alpn listener.
	PathALPN = "alpn"
	// PathUnknown is the ingress path when no other path can be identified.
	PathUnknown = "unknown"
)

Variables

This section is empty.

Functions

func HTTPConnStateReporter

func HTTPConnStateReporter(service string, r *Reporter) func(net.Conn, http.ConnState)

HTTPConnStateReporter returns a http connection event handler function to track connection metrics for an http server. This only tracks tls connections.

Types

type Reporter

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

Reporter provides a simple interface for tracking connection ingress metrics.

func NewReporter

func NewReporter(alpnAddr string) (*Reporter, error)

NewReporter constructs a new ingress reporter.

func (*Reporter) AuthenticatedConnectionClosed

func (r *Reporter) AuthenticatedConnectionClosed(service string, conn net.Conn)

AuthenticatedConnectionClosed reports a closed authenticated connection, this should only be called after ConnectionAuthenticated.

func (*Reporter) ConnectionAccepted

func (r *Reporter) ConnectionAccepted(service string, conn net.Conn)

ConnectionAccepted reports a new connection, ConnectionClosed must be called when the connection closes.

func (*Reporter) ConnectionAuthenticated

func (r *Reporter) ConnectionAuthenticated(service string, conn net.Conn)

ConnectionAuthenticated reports a new authenticated connection, AuthenticatedConnectionClosed must be called when the connection is closed.

func (*Reporter) ConnectionClosed

func (r *Reporter) ConnectionClosed(service string, conn net.Conn)

ConnectionClosed reports a closed connection. This should only be called after ConnectionAccepted.

Jump to

Keyboard shortcuts

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