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
group-level metadata for scraping.
type Manager ¶ added in v0.4.0
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Close ¶ added in v0.6.0
allows safe teardown when reloading downloader runtime while idle
func (*Manager) TotalCapacity ¶ added in v0.4.0
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
Click to show internal directories.
Click to hide internal directories.