Versions in this module Expand all Collapse all v0 v0.1.0 Dec 20, 2024 Changes in this version + var DefaultConfig = Config + type Config struct + BufferSize int + CacheTTL time.Duration + DialTimeout time.Duration + IdentifyTimeout time.Duration + MaxConnections int + type Metrics struct + ActiveConnections atomic.Int64 + CurrentInBytes atomic.Int64 + CurrentOutBytes atomic.Int64 + IdentifyErrors atomic.Int64 + LastInBytes atomic.Int64 + LastOutBytes atomic.Int64 + ProtocolHits sync.Map + ProtocolTraffic sync.Map + ProxyErrors atomic.Int64 + TotalInBytes atomic.Int64 + TotalOutBytes atomic.Int64 + type Option func(*Config) + func WithBufferSize(size int) Option + func WithCacheTTL(d time.Duration) Option + func WithDialTimeout(d time.Duration) Option + func WithIdentifyTimeout(d time.Duration) Option + func WithMaxConnections(n int) Option + type ProtocolManager struct + func NewProtocolManager(opts ...Option) *ProtocolManager + func (pm *ProtocolManager) AddProtocol(p *protocols.Protocol) + func (pm *ProtocolManager) Close() + func (pm *ProtocolManager) GetMetrics() map[string]interface{} + func (pm *ProtocolManager) GetProtocols() []*protocols.Protocol + func (pm *ProtocolManager) RemoveProtocol(name string) + func (pm *ProtocolManager) RunServer(ctx context.Context, address string) error + func (pm *ProtocolManager) UpdateProtocol(name string, newProtocol *protocols.Protocol) + type ProtocolTrafficStats struct + CurrentIn atomic.Int64 + CurrentOut atomic.Int64 + LastIn atomic.Int64 + LastOut atomic.Int64 + TotalIn atomic.Int64 + TotalOut atomic.Int64 + type TrafficCounter struct + func (tc *TrafficCounter) Read(p []byte) (n int, err error) + func (tc *TrafficCounter) Write(p []byte) (n int, err error)