processor

package
v0.7.14 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MessageName = "process_torrent"

Variables

This section is empty.

Functions

func NewQueueJob added in v0.7.0

func NewQueueJob(msg MessageParams, options ...model.QueueJobOption) (model.QueueJob, error)

Types

type ClassifyMode

type ClassifyMode int
const (
	// ClassifyModeDefault will use any pre-existing content match as a hint
	// This is the most common use case and will only attempt to match previously unmatched torrents
	ClassifyModeDefault ClassifyMode = iota
	// ClassifyModeRematch will ignore any pre-existing classification and always classify from scratch
	// This is useful if there are errors in matches from an earlier version that need to be corrected
	ClassifyModeRematch
	// ClassifyModeSkipUnmatched will skip classification for previously unmatched torrents (that don't have any hint)
	// This is useful for eliminating expensive API calls while running the rest of the processing pipeline
	ClassifyModeSkipUnmatched
)

type MessageParams

type MessageParams struct {
	ClassifyMode ClassifyMode
	InfoHashes   []protocol.ID
}

type MissingHashesError

type MissingHashesError struct {
	InfoHashes []protocol.ID
}

func (MissingHashesError) Error

func (e MissingHashesError) Error() string

type Params

type Params struct {
	fx.In
	Search     lazy.Lazy[search.Search]
	Classifier lazy.Lazy[classifier.Classifier]
	Dao        lazy.Lazy[*dao.Query]
	Logger     *zap.SugaredLogger
}

type Processor

type Processor interface {
	Process(ctx context.Context, params MessageParams) error
}

type Result

type Result struct {
	fx.Out
	Processor lazy.Lazy[Processor]
}

func New

func New(p Params) Result

Directories

Path Synopsis
queue

Jump to

Keyboard shortcuts

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