store

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PersistentStore

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

func NewPersistentStore

func NewPersistentStore(dbPath, blobDir string) (*PersistentStore, error)

func (*PersistentStore) Close

func (s *PersistentStore) Close() error

func (*PersistentStore) CreateNZBWriter

func (s *PersistentStore) CreateNZBWriter(id string) (io.WriteCloser, error)

func (*PersistentStore) Exists

func (s *PersistentStore) Exists(id string) bool

func (*PersistentStore) GetActiveQueueItems

func (s *PersistentStore) GetActiveQueueItems(ctx context.Context) ([]*domain.QueueItem, error)

GetActiveQueueItems returns all jobs that are not in a terminal state (Completed/Failed).

func (*PersistentStore) GetNZBReader

func (s *PersistentStore) GetNZBReader(id string) (io.ReadCloser, error)

func (*PersistentStore) GetQueueItem

func (s *PersistentStore) GetQueueItem(ctx context.Context, id string) (*domain.QueueItem, error)

GetQueueItem fetches a single job by its ID, fully hydrated with its Release.

func (*PersistentStore) GetQueueItems

func (s *PersistentStore) GetQueueItems(ctx context.Context) ([]*domain.QueueItem, error)

GetQueueItems returns all items in the queue, ordered by creation date.

func (*PersistentStore) GetRelease

func (s *PersistentStore) GetRelease(ctx context.Context, id string) (*domain.Release, error)

GetRelease fetches a single release

func (*PersistentStore) GetReleaseByHash

func (s *PersistentStore) GetReleaseByHash(ctx context.Context, hash string) (*domain.Release, error)

GetReleaseByHash is used to check for duplicates before creating a new manual upload.

func (*PersistentStore) GetReleaseFiles

func (s *PersistentStore) GetReleaseFiles(ctx context.Context, releaseID string) ([]*domain.DownloadFile, error)

GetReleaseFiles retrieves all files and their cross-posted groups for a specific release.

func (*PersistentStore) ResetStuckQueueItems

func (s *PersistentStore) ResetStuckQueueItems(ctx context.Context, newStatus domain.JobStatus, oldStatuses ...domain.JobStatus) error

func (*PersistentStore) RunMigrations

func (s *PersistentStore) RunMigrations() error

func (*PersistentStore) SaveNZBAtomically added in v0.5.1

func (s *PersistentStore) SaveNZBAtomically(id string, data []byte) (err error)

func (*PersistentStore) SaveQueueItem

func (s *PersistentStore) SaveQueueItem(ctx context.Context, item *domain.QueueItem) error

func (*PersistentStore) SaveReleaseFiles

func (s *PersistentStore) SaveReleaseFiles(ctx context.Context, releaseID string, files []*domain.DownloadFile) error

SaveReleaseFiles maps the actual NZB file contents into the database.

func (*PersistentStore) SearchReleases

func (s *PersistentStore) SearchReleases(ctx context.Context, query string) ([]*domain.Release, error)

SearchReleases returns releases matching a title query

func (*PersistentStore) UpdateReleaseHash

func (s *PersistentStore) UpdateReleaseHash(ctx context.Context, id string, hash string) error

UpdateReleaseHash is used when an indexer result finally downloads its NZB.

func (*PersistentStore) UpsertReleases

func (s *PersistentStore) UpsertReleases(ctx context.Context, results []*domain.Release) error

UpsertReleases handles bulk search results or manual additions.

Jump to

Keyboard shortcuts

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