QBitRun/lib/qbitrun/qbitrun.go

40 lines
990 B
Go
Raw Permalink Normal View History

package qbitrun
2024-06-27 16:47:11 +07:00
import "github.com/tigorlazuardi/qbitrun/lib/workflow"
type QBitRun struct {
context RunnerContext
2024-06-27 16:47:11 +07:00
workflow workflow.WorkflowInput
}
// New creates a QBitRun instance intended for single session.
//
// QBitRun assumes ownership of the WorkflowDir and will close all files
// when the session is done.
//
// Users must not use or modify the []io.ReadCloser in the WorkflowDir after
// calling this function, especially if the WorkflowDir is created using
// WorkflowFromReadClosers or WorkflowFromReaders.
2024-06-27 16:47:11 +07:00
func New(workflows workflow.WorkflowInput, ctx RunnerContext) *QBitRun {
return &QBitRun{
context: ctx,
workflow: workflows,
}
}
type RunnerContext struct {
TorrentName string
Category string
Tags []string
ContentPath string
RootPath string
SavePath string
NumberOfFiles int
TorrentSize uint64
CurrentTracker string
InfoHashV1 string
InfoHashV2 string
TorrentID string
AddEvent bool
}