listener

package
v0.0.0-...-52fba49 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseListener

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

BaseListener provides common listener functionality

func NewBaseListener

func NewBaseListener(config *Config) *BaseListener

NewBaseListener creates a new base listener

func (*BaseListener) GetConfig

func (l *BaseListener) GetConfig() *Config

GetConfig implements the Listener interface

func (*BaseListener) SetConfig

func (l *BaseListener) SetConfig(config *Config) error

SetConfig implements the Listener interface

func (*BaseListener) Start

func (l *BaseListener) Start(ctx context.Context) error

Start implements the Listener interface

func (*BaseListener) Stop

func (l *BaseListener) Stop() error

Stop implements the Listener interface

type Config

type Config struct {
	Protocol    string
	Address     string
	Port        int
	TLSConfig   *tls.Config
	MaxClients  int
	BufferSize  int
	ReadTimeout int
}

Config holds the listener configuration

type Listener

type Listener interface {
	// Start begins listening for connections
	Start(ctx context.Context) error
	// Stop gracefully shuts down the listener
	Stop() error
	// GetConfig returns the current configuration
	GetConfig() *Config
	// SetConfig updates the listener configuration
	SetConfig(*Config) error
}

Listener represents a network listener

Jump to

Keyboard shortcuts

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