jobs

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateInput

type CreateInput struct {
	JobID         string
	TorrentHash   string
	ReleaseName   string
	SourceTracker string
	SourcePath    string
	WorkspacePath string
	InputPath     string
	SourceSize    int64
}

type Job

type Job struct {
	ID               string
	TorrentHash      string
	ReleaseName      string
	SourceTracker    string
	SourcePath       string
	WorkspacePath    string
	InputPath        string
	SourceSize       int64
	BytesTransferred int64
	State            State
	RetryFrom        State
	RetryCount       int
	LastError        string
	PestoPID         int
	PestoExitCode    *int
	PestoStartedAt   *time.Time
	PestoCompletedAt *time.Time
	NZBPath          string
	ArchivePassword  string
	GoNZBReleaseID   string
	CreatedAt        time.Time
	UpdatedAt        time.Time
	CompletedAt      *time.Time
}

type State

type State string
const (
	StateDiscovered             State = "discovered"
	StateReserved               State = "reserved"
	StateTransferring           State = "transferring"
	StateTransferred            State = "transferred"
	StatePosting                State = "posting"
	StateNZBReady               State = "nzb_ready"
	StateSubmitting             State = "submitting"
	StateComplete               State = "complete"
	StateFailed                 State = "failed"
	StateReconciliationRequired State = "reconciliation_required"
)

type Store

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

func Open

func Open(filename string) (*Store, error)

func (*Store) ByHash

func (s *Store) ByHash(ctx context.Context, hash string) (*Job, error)

func (*Store) ByID

func (s *Store) ByID(ctx context.Context, id string) (*Job, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) MarkComplete

func (s *Store) MarkComplete(ctx context.Context, id, releaseID string, completed time.Time) error

func (*Store) MarkPestoComplete

func (s *Store) MarkPestoComplete(ctx context.Context, id, nzbPath, password string, exitCode int, completed time.Time) error

func (*Store) MarkPestoStarted

func (s *Store) MarkPestoStarted(ctx context.Context, id string, pid int, started time.Time) error

func (*Store) MarkReconciliationRequired

func (s *Store) MarkReconciliationRequired(ctx context.Context, id string, exitCode *int, cause error) error

func (*Store) MarkRetryableFailure

func (s *Store) MarkRetryableFailure(ctx context.Context, id string, retryFrom State, cause error) error

func (*Store) MarkSubmitting

func (s *Store) MarkSubmitting(ctx context.Context, id string) error

func (*Store) MarkTransferStarted

func (s *Store) MarkTransferStarted(ctx context.Context, id string) error

func (*Store) MarkTransferred

func (s *Store) MarkTransferred(ctx context.Context, id string, bytes int64) error

func (*Store) NextRunnable

func (s *Store) NextRunnable(ctx context.Context) (*Job, error)

func (*Store) ReconcileInterruptedPosts

func (s *Store) ReconcileInterruptedPosts(ctx context.Context) (int64, error)

func (*Store) Reserve

func (s *Store) Reserve(ctx context.Context, in CreateInput) (*Job, bool, error)

func (*Store) SetState

func (s *Store) SetState(ctx context.Context, id string, state State) error

Jump to

Keyboard shortcuts

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