classifier

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMatch = errors.New("no match")
)

Functions

This section is empty.

Types

type Classifier

type Classifier interface {
	Classify(ctx context.Context, infoHashes ...protocol.ID) error
}

type MissingHashesError

type MissingHashesError struct {
	InfoHashes []protocol.ID
}

func (MissingHashesError) Error

func (e MissingHashesError) Error() string

type Params

type Params struct {
	fx.In
	Search       search.Search
	SubResolvers []SubResolver `group:"content_resolvers"`
	Dao          *dao.Query
	Logger       *zap.SugaredLogger
}

type Resolver added in v0.2.0

type Resolver interface {
	Resolve(ctx context.Context, content model.TorrentContent) (model.TorrentContent, error)
}

type Result

type Result struct {
	fx.Out
	Classifier   Classifier
	Duration     prometheus.Collector `group:"prometheus_collectors"`
	SuccessTotal prometheus.Collector `group:"prometheus_collectors"`
	NoMatchTotal prometheus.Collector `group:"prometheus_collectors"`
	ErrorTotal   prometheus.Collector `group:"prometheus_collectors"`
}

func New

func New(p Params) Result

type SubResolver added in v0.2.0

type SubResolver interface {
	Config() SubResolverConfig
	PreEnrich(content model.TorrentContent) (model.TorrentContent, error)
	Resolver
}

type SubResolverConfig added in v0.2.0

type SubResolverConfig struct {
	Key      string
	Priority int
}

Directories

Path Synopsis
asynq

Jump to

Keyboard shortcuts

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