Documentation
¶
Index ¶
- type PersistentStore
- func (s *PersistentStore) Close() error
- func (s *PersistentStore) CreateNZBWriter(id string) (io.WriteCloser, error)
- func (s *PersistentStore) Exists(id string) bool
- func (s *PersistentStore) GetActiveQueueItems(ctx context.Context) ([]*domain.QueueItem, error)
- func (s *PersistentStore) GetNZBReader(id string) (io.ReadCloser, error)
- func (s *PersistentStore) GetQueueItem(ctx context.Context, id string) (*domain.QueueItem, error)
- func (s *PersistentStore) GetQueueItems(ctx context.Context) ([]*domain.QueueItem, error)
- func (s *PersistentStore) GetRelease(ctx context.Context, id string) (*domain.Release, error)
- func (s *PersistentStore) GetReleaseByHash(ctx context.Context, hash string) (*domain.Release, error)
- func (s *PersistentStore) GetReleaseFiles(ctx context.Context, releaseID string) ([]*domain.DownloadFile, error)
- func (s *PersistentStore) ResetStuckQueueItems(ctx context.Context, newStatus domain.JobStatus, ...) error
- func (s *PersistentStore) RunMigrations() error
- func (s *PersistentStore) SaveNZBAtomically(id string, data []byte) (err error)
- func (s *PersistentStore) SaveQueueItem(ctx context.Context, item *domain.QueueItem) error
- func (s *PersistentStore) SaveReleaseFiles(ctx context.Context, releaseID string, files []*domain.DownloadFile) error
- func (s *PersistentStore) SearchReleases(ctx context.Context, query string) ([]*domain.Release, error)
- func (s *PersistentStore) UpdateReleaseHash(ctx context.Context, id string, hash string) error
- func (s *PersistentStore) UpsertReleases(ctx context.Context, results []*domain.Release) error
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 ¶
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 ¶
GetQueueItem fetches a single job by its ID, fully hydrated with its Release.
func (*PersistentStore) GetQueueItems ¶
GetQueueItems returns all items in the queue, ordered by creation date.
func (*PersistentStore) GetRelease ¶
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 (*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 (*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 ¶
UpdateReleaseHash is used when an indexer result finally downloads its NZB.
func (*PersistentStore) UpsertReleases ¶
UpsertReleases handles bulk search results or manual additions.