Documentation
¶
Index ¶
- Constants
- Variables
- type AddNzbOption
- func AddNzbCategory(category string) AddNzbOption
- func AddNzbName(name string) AddNzbOption
- func AddNzbPriority(priority int) AddNzbOption
- func AddNzbScript(script string) AddNzbOption
- func AddNzbUnpackingOption(unpackingOption int) AddNzbOption
- func AddNzbUrl(url string) AddNzbOption
- func AddNzbXCategory(xcategory string) AddNzbOption
- type AdvancedQueueResponse
- type AdvancedQueueSlot
- type BytesFromB
- type BytesFromGB
- type BytesFromKB
- type BytesFromMB
- type HistoryResponse
- type HistorySlot
- type HistoryStageLog
- type ItemFile
- type ItemFilesResponse
- type Option
- func Addr(addr string) Option
- func ApikeyAuth(apikey string) Option
- func LoginAuth(username, password string) Option
- func NoneAuth() Option
- func Path(path string) Option
- func UseHTTPAuth(user, pass string) Option
- func UseHttp() Option
- func UseHttps() Option
- func UseInsecureHTTP() Option
- func UseRoundTripper(rt http.RoundTripper) Option
- type PostProcessingMethod
- type PriorityType
- type QueueCompleteAction
- type SabDuration
- type Sabnzbd
- func (s *Sabnzbd) AddFile(filename string, options ...AddNzbOption) (nzoids []string, err error)
- func (s *Sabnzbd) AddLocalfile(filename string, options ...AddNzbOption) (nzoids []string, err error)
- func (s *Sabnzbd) AddReader(reader io.Reader, filename string, options ...AddNzbOption) (nzoids []string, err error)
- func (s *Sabnzbd) AddURL(options ...AddNzbOption) (nzoids []string, err error)
- func (s *Sabnzbd) AdvancedQueue(start, limit int) (r *AdvancedQueueResponse, err error)
- func (s *Sabnzbd) Auth() (auth string, err error)
- func (s *Sabnzbd) Categories() (categories []string, err error)
- func (s *Sabnzbd) ChangeCategory(nzoid, category string) (err error)
- func (s *Sabnzbd) ChangeName(nzoid, name string) (err error)
- func (s *Sabnzbd) ChangePostProcessing(nzoid string, method PostProcessingMethod) (err error)
- func (s *Sabnzbd) ChangePriority(nzoid string, priority PriorityType) (err error)
- func (s *Sabnzbd) ChangeQueueCompleteAction(action QueueCompleteAction) (err error)
- func (s *Sabnzbd) ChangeScript(nzoid, script string) (err error)
- func (s *Sabnzbd) Delete(removeFiles bool, nzos ...string) (err error)
- func (s *Sabnzbd) DeleteAll(removeFiles bool) (err error)
- func (s *Sabnzbd) DeleteAllHistory(removeFailedFiles bool) (err error)
- func (s *Sabnzbd) DeleteFailedHistory(removeFailedFiles bool) (err error)
- func (s *Sabnzbd) DeleteHistory(removeFailedFiles bool, nzos ...string) (err error)
- func (s *Sabnzbd) GetItemFiles(nzoid string) (files []ItemFile, err error)
- func (s *Sabnzbd) History(start, limit int) (r *HistoryResponse, err error)
- func (s *Sabnzbd) Move(nzo1, nzo2 string) (err error)
- func (s *Sabnzbd) MoveByPriority(nzo string, priority int) (err error)
- func (s *Sabnzbd) Pause() (err error)
- func (s *Sabnzbd) PauseItem(nzoid string) (err error)
- func (s *Sabnzbd) PausePostProcessing() (err error)
- func (s *Sabnzbd) PauseTemporarily(t time.Duration) (err error)
- func (s *Sabnzbd) Restart() (err error)
- func (s *Sabnzbd) Resume() (err error)
- func (s *Sabnzbd) ResumeItem(nzoid string) (err error)
- func (s *Sabnzbd) ResumePostProcessing() (err error)
- func (s *Sabnzbd) Retry(nzoid string) (err error)
- func (s *Sabnzbd) Scripts() (scripts []string, err error)
- func (s *Sabnzbd) SetOptions(options ...Option) (err error)
- func (s *Sabnzbd) Shutdown() (err error)
- func (s *Sabnzbd) SimpleQueue() (r *SimpleQueueResponse, err error)
- func (s *Sabnzbd) SpeedLimit(kbps int) (err error)
- func (s *Sabnzbd) Version() (version string, err error)
- func (s *Sabnzbd) Warnings() (warnings []string, err error)
- type SimpleQueueJob
- type SimpleQueueResponse
Constants ¶
View Source
const ( PriorityDefault PriorityType = -100 PriorityPaused = -2 PriorityLow = -1 PriorityNormal = 0 PriorityHigh = 1 PriorityForced = 2 )
Variables ¶
View Source
var ( ErrApikeyIncorrect error = errors.New("API Key Incorrect") ErrApikeyRequired error = errors.New("API Key Required") )
View Source
var ErrInvalidQueueCompleteAction error = errors.New("invalid queue complete action")
Functions ¶
This section is empty.
Types ¶
type AddNzbOption ¶
type AddNzbOption func(*addNzbConfig) error
func AddNzbCategory ¶
func AddNzbCategory(category string) AddNzbOption
func AddNzbName ¶
func AddNzbName(name string) AddNzbOption
func AddNzbPriority ¶
func AddNzbPriority(priority int) AddNzbOption
func AddNzbScript ¶
func AddNzbScript(script string) AddNzbOption
func AddNzbUnpackingOption ¶
func AddNzbUnpackingOption(unpackingOption int) AddNzbOption
func AddNzbUrl ¶
func AddNzbUrl(url string) AddNzbOption
func AddNzbXCategory ¶
func AddNzbXCategory(xcategory string) AddNzbOption
type AdvancedQueueResponse ¶
type AdvancedQueueResponse struct {
CacheLimit string `json:"cache_limit"`
Categories []string `json:"categories"`
Scripts []string `json:"scripts"`
Paused bool `json:"paused"`
NewRelURL string `json:"new_rel_url"`
RestartRequested bool `json:"restart_req"`
Slots []AdvancedQueueSlot `json:"slots"`
HelpURI string `json:"helpuri"`
Uptime string `json:"uptime"`
RefreshRate string `json:"refresh_rate"`
IsVerbose bool `json:"isverbose"`
Start int `json:"start"`
Version string `json:"version"`
DownloadDiskTotalSpace BytesFromGB `json:"diskspacetotal1"`
CompleteDiskTotalSpace BytesFromGB `json:"diskspacetotal2"`
ColorScheme string `json:"color_scheme"`
Darwin bool `json:"darwin"`
NT bool `json:"nt"`
Status string `json:"status"`
LastWarning string `json:"last_warning"`
HaveWarnings string `json:"have_warnings"`
CacheArt string `json:"cache_art"`
FinishAction *string `json:"finishaction"`
NoOfSlots int `json:"noofslots"`
CacheSize string `json:"cache_size"`
Finish int `json:"finish"`
NewRelease string `json:"new_release"`
PauseInt string `json:"pause_int"`
Bytes BytesFromMB `json:"mb"`
BytesLeft BytesFromMB `json:"mbleft"`
TimeLeft SabDuration `json:"timeleft"`
ETA string `json:"eta"`
DownloadDiskFreeSpace BytesFromGB `json:"diskspace1"`
CompleteDiskFreeSpace BytesFromGB `json:"diskspace2"`
NZBQuota string `json:"nzb_quota"`
LoadAverage string `json:"loadavg"`
Limit int `json:"limit"`
BytesPerSec BytesFromKB `json:"kbpersec"`
SpeedLimit string `json:"speedlimit"`
WebDir string `json:"webdir"`
QueueDetails string `json:"queue_details"`
// contains filtered or unexported fields
}
func (*AdvancedQueueResponse) UnmarshalJSON ¶
func (r *AdvancedQueueResponse) UnmarshalJSON(data []byte) error
type AdvancedQueueSlot ¶
type AdvancedQueueSlot struct {
Status string `json:"status"`
Index int `json:"index"`
ETA string `json:"eta"`
TimeLeft SabDuration `json:"timeleft"`
AverageAge string `json:"avg_age"`
Script string `json:"script"`
MsgID string `json:"msgid"`
Verbosity string `json:"verbosity"`
Bytes BytesFromMB `json:"mb"`
Filename string `json:"filename"`
Priority string `json:"priority"`
Category string `json:"cat"`
BytesLeft BytesFromMB `json:"mbleft"`
Percentage string `json:"percentage"`
NzoID string `json:"nzo_id"`
UnpackOpts string `json:"unpackopts"`
Size string `json:"size"`
}
type BytesFromB ¶
type BytesFromB int
func (*BytesFromB) UnmarshalJSON ¶
func (b *BytesFromB) UnmarshalJSON(data []byte) error
type BytesFromGB ¶
type BytesFromGB int
func (*BytesFromGB) UnmarshalJSON ¶
func (b *BytesFromGB) UnmarshalJSON(data []byte) error
type BytesFromKB ¶
type BytesFromKB int
func (*BytesFromKB) UnmarshalJSON ¶
func (b *BytesFromKB) UnmarshalJSON(data []byte) error
type BytesFromMB ¶
type BytesFromMB int
func (*BytesFromMB) UnmarshalJSON ¶
func (b *BytesFromMB) UnmarshalJSON(data []byte) error
type HistoryResponse ¶
type HistoryResponse struct {
TotalSize string `json:"total_size"`
MonthSize string `json:"month_size"`
WeekSize string `json:"week_size"`
CacheLimit string `json:"cache_limit"`
Paused bool `json:"paused"`
NewRelURL string `json:"string"`
RestartRequested bool `json:"restart_req"`
Slots []HistorySlot `json:"slots"`
HelpURI string `json:"helpuri"`
Uptime string `json:"uptime"`
Version string `json:"version"`
DownloadDiskTotalSpace BytesFromGB `json:"diskspacetotal1"`
CompleteDiskTotalSpace BytesFromGB `json:"diskspacetotal2"`
ColorScheme string `json:"color_scheme"`
Darwin bool `json:"darwin"`
NT bool `json:"nt"`
Status string `json:"status"`
LastWarning string `json:"last_warning"`
HaveWarnings string `json:"have_warnings"`
CacheArt string `json:"cache_art"`
FinishAction *string `json:"finishaction"`
NoOfSlots int `json:"noofslots"`
CacheSize string `json:"cache_size"`
NewRelease string `json:"new_release"`
PauseInt string `json:"pause_int"`
Bytes BytesFromMB `json:"mb"`
BytesLeft BytesFromMB `json:"mbleft"`
TimeLeft SabDuration `json:"timeleft"`
ETA string `json:"eta"`
DownloadDiskFreeSpace BytesFromGB `json:"diskspace1"`
CompleteDiskFreeSpace BytesFromGB `json:"diskspace2"`
NZBQuota string `json:"nzb_quota"`
LoadAverage string `json:"loadavg"`
BytesPerSec BytesFromKB `json:"kbpersec"`
SpeedLimit string `json:"speedlimit"`
WebDir string `json:"webdir"`
// contains filtered or unexported fields
}
func (*HistoryResponse) UnmarshalJSON ¶
func (r *HistoryResponse) UnmarshalJSON(data []byte) error
type HistorySlot ¶
type HistorySlot struct {
ActionLine string `json:"action_line"`
ShowDetails string `json:"show_details"`
ScriptLog string `json:"script_log"`
FailMessage string `json:"fail_message"`
Loaded bool `json:"loaded"`
ID int `json:"id"`
Size string `json:"size"`
Category string `json:"category"`
PP string `json:"pp"`
Completeness int `json:"completeness"`
Script string `json:"script"`
NZBName string `json:"nzb_name"`
DownloadTime int `json:"download_time"` // change to time.Duration
Storage string `json:"storage"`
Status string `json:"status"`
ScriptLine string `json:"script_line"`
Completed int `json:"completed"` // change to time.Time
NzoID string `json:"nzo_id"`
Downloaded int `json:"downloaded"` // change to time.Time
Report string `json:"report"`
Path string `json:"path"`
PostProcessingTime int `json:"postproc_time"` // change to time.Duration
Name string `json:"name"`
URL string `json:"url"`
Bytes int `json:"bytes"`
URLInfo string `json:"url_info"`
StageLogs []HistoryStageLog `json:"stage_log"`
}
type HistoryStageLog ¶
type ItemFile ¶
type ItemFile struct {
ID string `json:"id"`
NzfID string `json:"nzf_id"`
Status string `json:"status"`
Filename string `json:"filename"`
Age string `json:"age"`
Bytes BytesFromB `json:"bytes"`
BytesLeft BytesFromMB `json:"mbleft"`
}
func (*ItemFile) UnmarshalJSON ¶
type ItemFilesResponse ¶
type ItemFilesResponse struct {
Files []ItemFile `json:"files"`
// contains filtered or unexported fields
}
type Option ¶
func ApikeyAuth ¶
func UseHTTPAuth ¶
func UseInsecureHTTP ¶
func UseInsecureHTTP() Option
func UseRoundTripper ¶
func UseRoundTripper(rt http.RoundTripper) Option
type PostProcessingMethod ¶
type PostProcessingMethod uint
const ( PostProcessingSkip PostProcessingMethod = iota PostProcessingRepair PostProcessingRepairUnpack PostProcessingRepairUnpackDelete )
type PriorityType ¶
type PriorityType int
type QueueCompleteAction ¶
type QueueCompleteAction uint
const ( QueueCompleteShutdownPC QueueCompleteAction = iota QueueCompleteHibernatePC QueueCompleteStandbyPC QueueCompleteShutdownProgram )
type SabDuration ¶
func (*SabDuration) UnmarshalJSON ¶
func (d *SabDuration) UnmarshalJSON(data []byte) error
type Sabnzbd ¶
type Sabnzbd struct {
// contains filtered or unexported fields
}
func (*Sabnzbd) AddFile ¶
func (s *Sabnzbd) AddFile(filename string, options ...AddNzbOption) (nzoids []string, err error)
func (*Sabnzbd) AddLocalfile ¶
func (s *Sabnzbd) AddLocalfile(filename string, options ...AddNzbOption) (nzoids []string, err error)
func (*Sabnzbd) AddURL ¶
func (s *Sabnzbd) AddURL(options ...AddNzbOption) (nzoids []string, err error)
func (*Sabnzbd) AdvancedQueue ¶
func (s *Sabnzbd) AdvancedQueue(start, limit int) (r *AdvancedQueueResponse, err error)
func (*Sabnzbd) Categories ¶
func (*Sabnzbd) ChangeCategory ¶
func (*Sabnzbd) ChangeName ¶
func (*Sabnzbd) ChangePostProcessing ¶
func (s *Sabnzbd) ChangePostProcessing(nzoid string, method PostProcessingMethod) (err error)
func (*Sabnzbd) ChangePriority ¶
func (s *Sabnzbd) ChangePriority(nzoid string, priority PriorityType) (err error)
func (*Sabnzbd) ChangeQueueCompleteAction ¶
func (s *Sabnzbd) ChangeQueueCompleteAction(action QueueCompleteAction) (err error)
func (*Sabnzbd) ChangeScript ¶
func (*Sabnzbd) DeleteAllHistory ¶
func (*Sabnzbd) DeleteFailedHistory ¶
func (*Sabnzbd) DeleteHistory ¶
func (*Sabnzbd) GetItemFiles ¶
func (*Sabnzbd) History ¶
func (s *Sabnzbd) History(start, limit int) (r *HistoryResponse, err error)
func (*Sabnzbd) Move ¶
todo deal with return value { "result": { "priority": int, "position": int } }
func (*Sabnzbd) MoveByPriority ¶
func (*Sabnzbd) PausePostProcessing ¶
func (*Sabnzbd) PauseTemporarily ¶
PauseTemporarily will pause for a time duration. The lowest possible value is one minute. Durations below one minute will resume the queue.
func (*Sabnzbd) ResumeItem ¶
func (*Sabnzbd) ResumePostProcessing ¶
func (*Sabnzbd) SetOptions ¶
func (*Sabnzbd) SimpleQueue ¶
func (s *Sabnzbd) SimpleQueue() (r *SimpleQueueResponse, err error)
func (*Sabnzbd) SpeedLimit ¶
type SimpleQueueJob ¶
type SimpleQueueJob struct {
ID string `json:"id"`
MsgID string `json:"msgid"`
Filename string `json:"filename"`
BytesLeft BytesFromMB `json:"mbleft"`
Bytes BytesFromMB `json:"mb"`
}
type SimpleQueueResponse ¶
type SimpleQueueResponse struct {
TimeLeft SabDuration `json:"timeleft"`
Size BytesFromMB `json:"mb"`
NoOfSlots int `json:"noofslots"`
Paused bool `json:"paused"`
BytesLeft BytesFromMB `json:"mbleft"`
DownloadDiskFreeSpace BytesFromGB `json:"diskspace1"`
CompleteDiskFreeSpace BytesFromGB `json:"diskspace2"`
BytesPerSec BytesFromKB `json:"kbpersec"`
Jobs []SimpleQueueJob `json:"jobs"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.