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 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 SecureAddr(host 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 QueueResponse
- type QueueSlot
- 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) 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) Queue(start, limit int) (r *QueueResponse, 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 (c *Sabnzbd) ServerStats() (r *ServerStatsResponse, err error)
- func (s *Sabnzbd) SetOptions(options ...Option) (err error)
- func (s *Sabnzbd) Shutdown() (err error)
- func (s *Sabnzbd) SimpleHistory() (r *HistoryResponse, err error)
- func (s *Sabnzbd) SimpleQueue() (r *QueueResponse, 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 ServerStatsDate
- type ServerStatsResponse
- type ServerStatsServer
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 BytesFromB ¶
type BytesFromB int
func (BytesFromB) String ¶ added in v2.1.0
func (b BytesFromB) String() string
func (*BytesFromB) UnmarshalJSON ¶
func (b *BytesFromB) UnmarshalJSON(data []byte) error
type BytesFromGB ¶
type BytesFromGB int
func (BytesFromGB) String ¶ added in v2.1.0
func (b BytesFromGB) String() string
func (*BytesFromGB) UnmarshalJSON ¶
func (b *BytesFromGB) UnmarshalJSON(data []byte) error
type BytesFromKB ¶
type BytesFromKB int
func (BytesFromKB) String ¶ added in v2.1.0
func (b BytesFromKB) String() string
func (*BytesFromKB) UnmarshalJSON ¶
func (b *BytesFromKB) UnmarshalJSON(data []byte) error
type BytesFromMB ¶
type BytesFromMB int
func (BytesFromMB) String ¶ added in v2.1.0
func (b BytesFromMB) String() string
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"` DaySize string `json:"day_size"` Slots []HistorySlot `json:"slots"` NoOfSlots int `json:"noofslots"` Version string `json:"version"` LastHistoryUpdate int `json:"last_history_update"` // contains filtered or unexported fields }
func (*HistoryResponse) UnmarshalJSON ¶
func (r *HistoryResponse) UnmarshalJSON(data []byte) error
type HistorySlot ¶
type HistorySlot struct { ID int `json:"id"` CompletedUnix int64 `json:"completed"` Completed time.Time Name string `json:"name"` NZBName string `json:"nzb_name"` Category string `json:"category"` PP string `json:"pp"` Script string `json:"script"` Report string `json:"report"` URL string `json:"url"` Status string `json:"status"` NzoID string `json:"nzo_id"` Storage string `json:"storage"` Path string `json:"path"` ScriptLog string `json:"script_log"` ScriptLine string `json:"script_line"` DownloadTime int64 `json:"download_time"` DownloadDuration time.Duration PostProcessingTime int64 `json:"postproc_time"` PostProcessingDuration time.Duration StageLogs []HistoryStageLog `json:"stage_log"` Downloaded int64 `json:"downloaded"` // represents downloaded bytes, not time Completeness int `json:"completeness"` FailMessage string `json:"fail_message"` URLInfo string `json:"url_info"` Bytes int `json:"bytes"` Meta string `json:"meta"` Series string `json:"series"` MD5Sum string `json:"md5sum"` Password string `json:"password"` ActionLine string `json:"action_line"` Size string `json:"size"` Loaded bool `json:"loaded"` Retry int }
func (*HistorySlot) UnmarshalJSON ¶ added in v2.3.0
func (r *HistorySlot) UnmarshalJSON(data []byte) error
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 SecureAddr ¶
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 QueueResponse ¶
type QueueResponse struct { Version string `json:"version"` Paused bool `json:"paused"` PauseInt string `json:"pause_int"` PausedAll bool `json:"paused_all"` DownloadDiskFreeSpace BytesFromGB `json:"diskspace1"` CompleteDiskFreeSpace BytesFromGB `json:"diskspace2"` Diskspace1Norm string `json:"diskspace1_norm"` Diskspace2Norm string `json:"diskspace2_norm"` DownloadDiskTotalSpace BytesFromGB `json:"diskspacetotal1"` CompleteDiskTotalSpace BytesFromGB `json:"diskspacetotal2"` SpeedLimitPercentage int `json:"speedlimit,string"` SpeedLimit BytesFromB `json:"speedlimit_abs"` HaveWarnings string `json:"have_warnings"` FinishAction *string `json:"finishaction"` Quota string `json:"quota"` HaveQuota bool `json:"have_quota"` LeftQuota string `json:"left_quota"` CacheArt string `json:"cache_art"` CacheSize string `json:"cache_size"` BytesPerSecond BytesFromKB `json:"kbpersec"` Speed string `json:"speed"` BytesLeft BytesFromMB `json:"mbleft"` BytesTotal BytesFromMB `json:"mb"` Bytes BytesFromMB SizeLeft string `json:"sizeleft"` Size string `json:"size"` NoOfSlotsTotal int `json:"noofslots_total"` NoOfSlots int `json:"noofslots"` Start int `json:"start"` Limit int `json:"limit"` Finish int `json:"finish"` Status string `json:"status"` TimeLeft SabDuration `json:"timeleft"` Slots []QueueSlot `json:"slots"` // contains filtered or unexported fields }
func (*QueueResponse) UnmarshalJSON ¶
func (r *QueueResponse) UnmarshalJSON(data []byte) error
type QueueSlot ¶
type QueueSlot struct { Index int `json:"index"` NzoID string `json:"nzo_id"` UnpackOpts string `json:"unpackopts"` Priority string `json:"priority"` Script string `json:"script"` Filename string `json:"filename"` Labels []string `json:"labels"` Password string `json:"password"` Category string `json:"cat"` BytesLeft BytesFromMB `json:"mbleft"` BytesTotal BytesFromMB `json:"mb"` Size string `json:"size"` SizeLeft string `json:"sizeleft"` Percentage int `json:"percentage,string"` MBMissing BytesFromMB `json:"mbmissing"` // doesn't seem to be working Bytes BytesFromMB DirectUnpack string `json:"direct_unpack"` Status string `json:"status"` TimeLeft SabDuration `json:"timeleft"` AverageAge string `json:"avg_age"` }
func (*QueueSlot) UnmarshalJSON ¶ added in v2.3.0
type SabDuration ¶
func (SabDuration) String ¶ added in v2.1.0
func (d SabDuration) String() string
func (*SabDuration) UnmarshalJSON ¶
func (d *SabDuration) UnmarshalJSON(data []byte) error
type Sabnzbd ¶
type Sabnzbd struct {
// contains filtered or unexported fields
}
func SecureClient ¶
func SimpleClient ¶
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) 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) Queue ¶ added in v2.1.0
func (s *Sabnzbd) Queue(start, limit int) (r *QueueResponse, err error)
func (*Sabnzbd) ResumeItem ¶
func (*Sabnzbd) ResumePostProcessing ¶
func (*Sabnzbd) ServerStats ¶ added in v2.2.0
func (c *Sabnzbd) ServerStats() (r *ServerStatsResponse, err error)
func (*Sabnzbd) SetOptions ¶
func (*Sabnzbd) SimpleHistory ¶
func (s *Sabnzbd) SimpleHistory() (r *HistoryResponse, err error)
func (*Sabnzbd) SimpleQueue ¶
func (s *Sabnzbd) SimpleQueue() (r *QueueResponse, err error)
func (*Sabnzbd) SpeedLimit ¶
type ServerStatsDate ¶ added in v2.2.0
type ServerStatsDate string
type ServerStatsResponse ¶ added in v2.2.0
type ServerStatsResponse struct { Total BytesFromB `json:"total"` Month BytesFromB `json:"month"` Week BytesFromB `json:"week"` Day BytesFromB `json:"day"` Servers map[string]ServerStatsServer `json:"servers"` }
type ServerStatsServer ¶ added in v2.2.0
type ServerStatsServer struct { Total BytesFromB `json:"total"` Month BytesFromB `json:"month"` Week BytesFromB `json:"week"` Day BytesFromB `json:"day"` Daily map[ServerStatsDate]BytesFromB `json:"daily"` ArticlesTried map[ServerStatsDate]int `json:"articles_tried"` ArticlesSuccess map[ServerStatsDate]int `json:"articles_success"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.