persistence

package
v0.0.5-beta.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRecordNotFound = gorm.ErrRecordNotFound

Functions

This section is empty.

Types

type ContentPersistence

type ContentPersistence interface {
	GetContent(ctx context.Context, ref model.ContentRef) (movie model.Content, err error)
}

type Params

type Params struct {
	fx.In
	Query *dao.Query
}

type Persistence

type Persistence interface {
	TorrentPersistence
	ContentPersistence
}

type Result

type Result struct {
	fx.Out
	Persistence Persistence
}

func New

func New(params Params) (Result, error)

type TorrentContentRef

type TorrentContentRef struct {
	model.ContentRef
	InfoHash model.Hash20
}

type TorrentPersistence

type TorrentPersistence interface {
	GetTorrent(ctx context.Context, infoHash model.Hash20) (torrent model.Torrent, err error)
	GetTorrents(ctx context.Context, infoHashes ...model.Hash20) (torrents []model.Torrent, missingInfoHashes []model.Hash20, err error)
	PutTorrent(ctx context.Context, torrent model.Torrent) error
	TorrentExists(ctx context.Context, infoHash model.Hash20) (bool, error)
	// GetPersistedInfoHashes returns the subset of provided hashes that are persisted in the database.
	GetPersistedInfoHashes(ctx context.Context, infoHashesToCheck []model.Hash20) ([]model.Hash20, error)
}

Jump to

Keyboard shortcuts

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