nntp

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrArticleNotFound = errors.New("article not found (430)")
View Source
var ErrProviderBusy = errors.New("all providers busy")

ErrProviderBusy indicates all nntp connections are in use

View Source
var FETCH_RETRY_COUNT = 3

Functions

This section is empty.

Types

type GroupStats added in v0.6.0

type GroupStats struct {
	Count int64
	Low   int64
	High  int64
	Group string
}

group-level metadata for scraping.

type Manager added in v0.4.0

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

func NewManager added in v0.4.0

func NewManager(ctx *app.Context) (*Manager, error)

func (*Manager) Close added in v0.6.0

func (m *Manager) Close() error

allows safe teardown when reloading downloader runtime while idle

func (*Manager) Fetch added in v0.4.0

func (m *Manager) Fetch(ctx context.Context, seg *domain.Segment, groups []string) (io.Reader, error)

func (*Manager) TotalCapacity added in v0.4.0

func (m *Manager) TotalCapacity() int

TotalCapacity returns the maximum number of concurrent connections allowed across all configured providers.

type OverviewHeader added in v0.6.0

type OverviewHeader struct {
	ArticleNumber int64
	Subject       string
	Poster        string
	DateUTC       *time.Time
	MessageID     string
	References    string
	Bytes         int64
	Lines         int
	Xref          string
	RawOverview   map[string]any
}

overview header shape for XOVER scraping.

type Provider added in v0.4.0

type Provider interface {
	ID() string
	Label() string
	Priority() int
	MaxConnection() int
	Fetch(ctx context.Context, msgID string, groups []string) (io.Reader, error)
	GroupStats(ctx context.Context, group string) (GroupStats, error)
	XOver(ctx context.Context, group string, from, to int64) ([]OverviewHeader, error)
	TestConnection() error
	Close() error
}

Provider represents the contract for a Usenet server connection.

func NewNNTPProvider

func NewNNTPProvider(c config.ServerConfig) Provider

func NewNNTPProviderWithLogger added in v0.7.0

func NewNNTPProviderWithLogger(c config.ServerConfig, log providerLogger) Provider

Jump to

Keyboard shortcuts

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