Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateHash ¶ added in v0.0.4
Types ¶
type Post ¶
type Post struct {
FilePath string
Articles []*article.Article
Status PostStatus
Error error
Retries int
// contains filtered or unexported fields
}
Post represents a file to be posted
type PostStatus ¶
type PostStatus int
PostStatus represents the status of a post
const ( PostStatusPending PostStatus = iota PostStatusPosted PostStatusVerified PostStatusFailed PostStatusCancelled )
type Poster ¶
type Poster interface {
// Post posts files from a directory to Usenet
Post(ctx context.Context, files []string, rootDir string, nzbGen nzb.NZBGenerator) error
// Stats returns posting statistics
Stats() Stats
// SetProgressCallback sets the progress callback function
SetProgressCallback(callback ProgressCallback)
// Close closes the poster
Close()
}
Poster defines the interface for posting articles to Usenet
type ProgressCallback ¶ added in v0.0.6
type ProgressCallback func(stage string, current, total int64, details string, speed float64, secondsLeft float64, elapsedTime float64)
ProgressCallback defines the interface for progress notifications
type ProgressManager ¶
type ProgressManager struct {
// contains filtered or unexported fields
}
ProgressManager handles progress tracking and display
func NewFileProgress ¶
func NewFileProgress( description string, totalBytes int64, articlesTotal int64, ) *ProgressManager
NewFileProgress creates a new progress bar for a file
func NewFileProgressWithCallback ¶ added in v0.0.6
func NewFileProgressWithCallback( description string, totalBytes int64, articlesTotal int64, callback ProgressCallback, ) *ProgressManager
NewFileProgressWithCallback creates a new progress bar for a file with a callback
func (*ProgressManager) FinishFileProgress ¶
func (pm *ProgressManager) FinishFileProgress()
FinishFileProgress completes the progress bar for a file
func (*ProgressManager) UpdateFileProgress ¶
func (pm *ProgressManager) UpdateFileProgress(bytesProcessed int64, articlesProcessed int64, articleErrors int64)
UpdateFileProgress updates the progress bar for a file
type Stats ¶
type Stats struct {
ArticlesPosted int64
ArticlesChecked int64
BytesPosted int64
ArticleErrors int64
StartTime time.Time
// contains filtered or unexported fields
}
Stats tracks posting statistics
type Throttle ¶
type Throttle struct {
// contains filtered or unexported fields
}
Throttle handles rate limiting
func NewThrottle ¶ added in v0.0.6
NewThrottle creates a new throttle with the given rate and interval
Click to show internal directories.
Click to hide internal directories.