Documentation
¶
Index ¶
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) GetCheckPool() nntppool.UsenetConnectionPool
- func (m *Manager) GetMetrics() (nntppool.PoolMetricsSnapshot, error)
- func (m *Manager) GetPool() nntppool.UsenetConnectionPool
- func (m *Manager) IsClosed() bool
- func (m *Manager) UpdateConfig(newCfg *config.ConfigData) error
- type PoolManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages NNTP connection pools throughout the application lifecycle, enabling proper metrics accumulation. Use dependency injection to pass this around. Supports separate pools for posting and article verification (check-only providers).
func New ¶
func New(cfg *config.ConfigData) (*Manager, error)
New creates a new connection pool manager with the given configuration. Creates separate pools for posting (excluding check-only) and checking (check-only or fallback).
func (*Manager) Close ¶
Close gracefully shuts down the connection pool manager. This should be called during application shutdown.
func (*Manager) GetCheckPool ¶ added in v0.0.29
func (m *Manager) GetCheckPool() nntppool.UsenetConnectionPool
GetCheckPool returns the NNTP connection pool for article verification. Returns check-only servers if configured, otherwise falls back to posting pool.
func (*Manager) GetMetrics ¶
func (m *Manager) GetMetrics() (nntppool.PoolMetricsSnapshot, error)
GetMetrics returns the current metrics from the connection pool.
func (*Manager) GetPool ¶
func (m *Manager) GetPool() nntppool.UsenetConnectionPool
GetPool returns the posting NNTP connection pool (excludes check-only servers). This is the method that replaces direct calls to cfg.GetNNTPPool().
func (*Manager) UpdateConfig ¶
func (m *Manager) UpdateConfig(newCfg *config.ConfigData) error
UpdateConfig updates the connection pools with a new configuration. This properly closes the old pools first, then creates new ones to prevent resource leaks.
type PoolManager ¶ added in v0.0.29
type PoolManager interface {
GetPool() nntppool.UsenetConnectionPool
GetCheckPool() nntppool.UsenetConnectionPool
}
PoolManager defines the interface for connection pool management. This interface is implemented by Manager and can be mocked for testing.