persistence

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 8 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 protocol.ID
}

type TorrentPersistence

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

Jump to

Keyboard shortcuts

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