rtdtserver

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: ISC Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(c *config)

Option is a functional server config option.

func WithCookieKey

func WithCookieKey(key *zkidentity.FixedSizeSymmetricKey, decodeKeys []*zkidentity.FixedSizeSymmetricKey) Option

WithCookieKey sets the symmetric key to use for encrypting cookies.

func WithIgnoreKernelStats

func WithIgnoreKernelStats() Option

WithIgnoreKernelStats disables tracking kernel stats. Only useful for testing.

func WithListenAddrs

func WithListenAddrs(addrs ...*net.UDPAddr) Option

WithListenAddrs establishes the listening addresses of the server. Both listen addresses and raw listeners can be used to start the server.

func WithListeners

func WithListeners(listeners ...*net.UDPConn) Option

WithListeners sets raw UDP listeners to be used with the server. Both listen addresses and raw listeners can be used to start the server.

func WithLogAndReplyErrors

func WithLogAndReplyErrors() Option

WithLogAndReplyErrors enables logging and replying of action errors.

NOTE: this should only be used for temporary debugging or automated testing.

func WithLogErrors

func WithLogErrors() Option

WithLogErrors enables logging of remotely generated errors.

NOTE: this should only be used for temporary debugging, because it may significantly increase log sizes.

func WithLogger

func WithLogger(l slog.Logger) Option

WithLogger sets up the server to use the logger. Logger MUST NOT be nil.

func WithPerListenerReadRoutines

func WithPerListenerReadRoutines(i int) Option

WithPerListenerReadRoutines sets the number of reading goroutines to use for processing each listener's incoming packets.

func WithPrivateKey

func WithPrivateKey(pk *zkidentity.FixedSizeSntrupPrivateKey) Option

WithPrivateKey sets the private key used for client-server encryption.

func WithPrometheusListenAddr

func WithPrometheusListenAddr(addr string) Option

WithPrometheusListenAddr sets the address to offer Prometheus metrics endpoint collection.

func WithReportStatsInterval

func WithReportStatsInterval(interval time.Duration) Option

WithReportStatsInterval sets the interval to log stats. If set to zero, reporting is disabled.

type Server

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

Server is an RTDT server.

func New

func New(opts ...Option) (*Server, error)

New creates a new RTDT server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run the server.

type UDPProcStats

type UDPProcStats struct {
	TXQueue int
	RXQueue int
	Drops   int
}

UDPProcStats tracks kernel stats.

Jump to

Keyboard shortcuts

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