Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrArticleNotFound = errors.New("article not found")
ErrArticleNotFound indicates a 430 response from Usenet
View Source
var ErrProviderBusy = errors.New("all providers busy")
ErrProviderBusy indicates all nntp connections are in use
Functions ¶
This section is empty.
Types ¶
type ArticleRespository ¶
type ArticleRespository interface {
FetchBody(messageID string) (io.Reader, error)
Authenticate() error
Close() error
}
ArticleRepository defines the contract for fetching data from Usenet.
type DownloadFile ¶
type DownloadFile struct {
Source *NZBFile
Segments []NZBSegment
CleanName string
PartPath string
FinalPath string
Size int64
// contains filtered or unexported fields
}
func NewDownloadFile ¶
func NewDownloadFile(raw NZBFile, cleanName, outDir string) *DownloadFile
func (*DownloadFile) GetActualSize ¶
func (f *DownloadFile) GetActualSize() int64
func (*DownloadFile) SetActualSize ¶
func (f *DownloadFile) SetActualSize(size int64)
type DownloadJob ¶
type DownloadJob struct {
Segment NZBSegment
File *DownloadFile
Groups []string
Offset int64
RetryCount int
}
type DownloadResult ¶
type DownloadResult struct {
Job DownloadJob
Error error
}
type NZBFile ¶
type NZBFile struct {
Subject string `xml:"subject,attr"`
Poster string `xml:"poster,attr"`
Groups []string `xml:"groups>group"`
Segments []NZBSegment `xml:"segments>segment"`
}
type NZBSegment ¶
type Provider ¶
type Provider interface {
ID() string
Priority() int
MaxConnection() int
Fetch(ctx context.Context, msgID string, groups []string) (io.Reader, error)
TestConnection() error
Close() error
}
Provider represents the contract for a Usenet server connection.
Click to show internal directories.
Click to hide internal directories.