processor

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 18 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
)

type MessageParams

type MessageParams struct {
	ClassifyMode       ClassifyMode
	ClassifierWorkflow string
	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
	ClassifierConfig classifier.Config
	Search           lazy.Lazy[search.Search]
	Workflow         lazy.Lazy[classifier.Runner]
	Dao              lazy.Lazy[*dao.Query]
	BlockingManager  lazy.Lazy[blocking.Manager]
	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

Jump to

Keyboard shortcuts

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