audiosrc

package
v0.0.0-...-c928bda Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder struct {
	// contains filtered or unexported fields
}

func NewFinder

func NewFinder(db *gorm.DB, searchers ...Searcher) *Finder

func (*Finder) GetSearcher

func (f *Finder) GetSearcher(service string) Searcher

func (*Finder) GetTrackSource

func (f *Finder) GetTrackSource(ctx context.Context, trackID uint64) (edb.TrackSource, error)

func (*Finder) Search

func (f *Finder) Search(ctx context.Context, track edb.Track) ([]Result, error)

func (*Finder) SearchOne

func (f *Finder) SearchOne(ctx context.Context, track edb.Track) (Result, error)

type Result

type Result struct {
	TrackSource edb.TrackSource
}

type Searcher

type Searcher interface {
	service.Identifier

	// Search searches for audio sources for the given track.
	// The track needs to have all associations pre-loaded.
	// The results must only include valid results and must be ordered from
	// best to worst.
	Search(ctx context.Context, track edb.Track) ([]Result, error)

	// Generate the qualified uri for the track source.
	GenerateTrackURI(source edb.TrackSource) string
}

Jump to

Keyboard shortcuts

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