Documentation ¶
Index ¶
- Constants
- type AppendInput
- type BytesPer
- type Config
- type ConfigTemplate
- type DeleteStatus
- type ExParStatus
- type File
- type Group
- type GroupStatus
- type History
- type LogEntry
- type LogKind
- type MarkStatus
- type MoveStatus
- type NZBGet
- func (n *NZBGet) Append(input *AppendInput) (int64, error)
- func (n *NZBGet) AppendContext(ctx context.Context, input *AppendInput) (int64, error)
- func (n *NZBGet) Config() ([]*Parameter, error)
- func (n *NZBGet) ConfigContext(ctx context.Context) ([]*Parameter, error)
- func (n *NZBGet) ConfigTemplates(loadFromDisk bool) ([]*ConfigTemplate, error)
- func (n *NZBGet) ConfigTemplatesContext(ctx context.Context, loadFromDisk bool) ([]*ConfigTemplate, error)
- func (n *NZBGet) EditQueue(command, parameter string, ids []int64) (bool, error)
- func (n *NZBGet) EditQueueContext(ctx context.Context, command, parameter string, ids []int64) (bool, error)
- func (n *NZBGet) GetInto(ctx context.Context, method string, output interface{}, args ...interface{}) error
- func (n *NZBGet) History(hidden bool) ([]*History, error)
- func (n *NZBGet) HistoryContext(ctx context.Context, hidden bool) ([]*History, error)
- func (n *NZBGet) ListFiles(nzbID int64) (*File, error)
- func (n *NZBGet) ListFilesContext(ctx context.Context, nzbID int64) (*File, error)
- func (n *NZBGet) ListGroups() ([]*Group, error)
- func (n *NZBGet) ListGroupsContext(ctx context.Context) ([]*Group, error)
- func (n *NZBGet) LoadConfig() ([]*Parameter, error)
- func (n *NZBGet) LoadConfigContext(ctx context.Context) ([]*Parameter, error)
- func (n *NZBGet) LoadLog(nzbID, startID, limit int64) ([]*LogEntry, error)
- func (n *NZBGet) LoadLogContext(ctx context.Context, nzbID, startID, limit int64) ([]*LogEntry, error)
- func (n *NZBGet) Log(startID, limit int64) ([]*LogEntry, error)
- func (n *NZBGet) LogContext(ctx context.Context, startID, limit int64) ([]*LogEntry, error)
- func (n *NZBGet) PauseDownload() (bool, error)
- func (n *NZBGet) PauseDownloadContext(ctx context.Context) (bool, error)
- func (n *NZBGet) PausePost() (bool, error)
- func (n *NZBGet) PausePostContext(ctx context.Context) (bool, error)
- func (n *NZBGet) PauseScan() (bool, error)
- func (n *NZBGet) PauseScanContext(ctx context.Context) (bool, error)
- func (n *NZBGet) Rate(limit int64) (bool, error)
- func (n *NZBGet) RateContext(ctx context.Context, limit int64) (bool, error)
- func (n *NZBGet) Reload() (bool, error)
- func (n *NZBGet) ReloadContext(ctx context.Context) (bool, error)
- func (n *NZBGet) ResetServerVolume(serverID int64, sounter string) (bool, error)
- func (n *NZBGet) ResetServerVolumeContext(ctx context.Context, serverID int64, sounter string) (bool, error)
- func (n *NZBGet) ResumeDownload() (bool, error)
- func (n *NZBGet) ResumeDownloadContext(ctx context.Context) (bool, error)
- func (n *NZBGet) ResumePost() (bool, error)
- func (n *NZBGet) ResumePostContext(ctx context.Context) (bool, error)
- func (n *NZBGet) ResumeScan() (bool, error)
- func (n *NZBGet) ResumeScanContext(ctx context.Context) (bool, error)
- func (n *NZBGet) SaveConfig(configs []*Parameter) (bool, error)
- func (n *NZBGet) SaveConfigContext(ctx context.Context, configs []*Parameter) (bool, error)
- func (n *NZBGet) Scan() (bool, error)
- func (n *NZBGet) ScanContext(ctx context.Context) (bool, error)
- func (n *NZBGet) ScheduleResume(wait time.Duration) (bool, error)
- func (n *NZBGet) ScheduleResumeContext(ctx context.Context, wait time.Duration) (bool, error)
- func (n *NZBGet) ServerVolumes() ([]*ServerVolume, error)
- func (n *NZBGet) ServerVolumesContext(ctx context.Context) ([]*ServerVolume, error)
- func (n *NZBGet) Shutdown() (bool, error)
- func (n *NZBGet) ShutdownContext(ctx context.Context) (bool, error)
- func (n *NZBGet) Status() (*Status, error)
- func (n *NZBGet) StatusContext(ctx context.Context) (*Status, error)
- func (n *NZBGet) Version() (string, error)
- func (n *NZBGet) VersionContext(ctx context.Context) (string, error)
- func (n *NZBGet) WriteLog(kind LogKind, text string) (bool, error)
- func (n *NZBGet) WriteLogContext(ctx context.Context, kind LogKind, text string) (bool, error)
- type NewsServers
- type ParStatus
- type Parameter
- type PerScriptStatus
- type ScriptStatus
- type ServerStats
- type ServerVolume
- type Status
- type Time
- type URLStatus
- type UnpackStatus
Constants ¶
const (
DefaultTimeout = 1 * time.Minute
)
Package defaults.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendInput ¶ added in v0.1.1
type AppendInput struct { Filename string Content string Category string Priority int64 AddToTop bool AddPaused bool DupeKey string // See: https://nzbget.net/rss#duplicate-keys DupeScore int64 // See: https://nzbget.net/rss#duplicate-scores DupeMode string // See: https://nzbget.net/rss#duplicate-modes Parameters []*Parameter }
AppendInput is the input data for the append method. See https://nzbget.net/api/append for more information about this data.
type BytesPer ¶ added in v0.1.1
type BytesPer struct { SizeLo int64 `json:"SizeLo"` // Amount of downloaded data, low 32-bits of 64-bit value. SizeHi int64 `json:"SizeHi"` // Amount of downloaded data, high 32-bits of 64-bit value. SizeMB int64 `json:"SizeMB"` // Amount of downloaded data, in megabytes. }
BytesPer is part of the ServerVolume structure.
type Config ¶
type Config struct { URL string `json:"url" toml:"url" xml:"url" yaml:"url"` User string `json:"user" toml:"user" xml:"user" yaml:"user"` Pass string `json:"pass" toml:"pass" xml:"pass" yaml:"pass"` Client *http.Client `json:"-" toml:"-" xml:"-" yaml:"-"` // optional. }
Config is the input data needed to return a NZBGet struct. This is setup to allow you to easily pass this data in from a config file.
type ConfigTemplate ¶ added in v0.1.1
type ConfigTemplate struct { Name string `json:"Name"` // Post-processing script name. For example “videosort/VideoSort.py”. This field is empty in the first record, which holds the config template of the program itself. DisplayName string `json:"DisplayName"` // Nice script name ready for displaying. For example “VideoSort”. PostScript bool `json:"PostScript"` // “True” for post-processing scripts. ScanScript bool `json:"ScanScript"` // “True” for scan scripts. QueueScript bool `json:"QueueScript"` // “True” for queue scripts. SchedulerScript bool `json:"SchedulerScript"` // “True” for scheduler scripts. Template string `json:"Template"` // Content of the configuration template (multiple lines). }
ConfigTemplate represents the configtemplate RPC endpoint output.
type DeleteStatus ¶
type DeleteStatus string
DeleteStatus determine if and why a download was removed.
const ( DeleteNONE DeleteStatus = "NONE" // not deleted; DeleteMANUAL DeleteStatus = "MANUAL" // the download was manually deleted by user; DeleteHEALTH DeleteStatus = "HEALTH" // the download was deleted by health check; DeleteDUPE DeleteStatus = "DUPE" // the download was deleted by duplicate check; DeleteBAD DeleteStatus = "BAD" // v14.0 the download was marked as BAD by a queue//script during download; DeleteSCAN DeleteStatus = "SCAN" // v16.0 the download was deleted because the nzb//file could not be parsed (malformed nzb//file); DeleteCOPY DeleteStatus = "COPY" // v16.0 the download was deleted by duplicate check because an nzb//file with exactly same content exists )
DeleteStatuses go here.
type ExParStatus ¶
type ExParStatus string
ExParStatus determines if the download was repaired using duplicate par-scan mode.
const ( ExParRECIPIENT ExParStatus = "RECIPIENT" // repaired using blocks from other duplicates; ExParDONOR ExParStatus = "DONOR" // has donated blocks to repair another duplicate; )
ExParStatuses go here.
type File ¶
type File struct { ID int64 `json:"ID"` // ID of file. NZBID int64 `json:"NZBID"` // ID of NZB//file. NZBFilename string `json:"NZBFilename"` // Name of nzb//file. The filename could include fullpath if client sent it by adding the file to queue. NZBName string `json:"NZBName"` // The name of nzb//file without path and extension. Ready for user//friendly output. Subject string `json:"Subject"` // Subject of article read from nzb//file. Filename string `json:"Filename"` // Filename parsed from subject. It could be incorrect since the subject not always correct formated. After the first article for file is read, the correct filename is read from article body. FilenameConfirmed bool `json:"FilenameConfirmed"` // “True” if filename was already read from article’s body. “False” if the name was parsed from subject. For confirmed filenames the destination file on disk will be exactly as specified in field “filename”. For unconfirmed filenames the name could change later. DestDir string `json:"DestDir"` // Destination directory for output file. FileSizeLo int64 `json:"FileSizeLo"` // Filesize in bytes, Low 32//bits of 64//bit value. FileSizeHi int64 `json:"FileSizeHi"` // Filesize in bytes, High 32//bits of 64//bit value. RemainingSizeLo int64 `json:"RemainingSizeLo"` // Remaining size in bytes, Low 32//bits of 64//bit value. RemainingSizeHi int64 `json:"RemainingSizeHi"` // Remaining size in bytes, High 32//bits of 64//bit value. Paused bool `json:"Paused"` // “True” if file is paused. PostTime int64 `json:"PostTime"` // Date/time when the file was posted to newsgroup Time is in C/Unix format. ActiveDownloads int64 `json:"ActiveDownloads"` // Number of active downloads for the file. With this filed can be determined what files is are being currently downloaded. Progress int64 `json:"Progress"` // v15.0 Download progress, a number in the range 0..1000. Divide it to 10 to get percent//value. }
File represents the listFiles RPC endpoint.
type Group ¶
type Group struct { NZBID int64 `json:"NZBID"` RemainingSizeLo int64 `json:"RemainingSizeLo"` RemainingSizeHi int64 `json:"RemainingSizeHi"` RemainingSizeMB int64 `json:"RemainingSizeMB"` PausedSizeLo int64 `json:"PausedSizeLo"` PausedSizeHi int64 `json:"PausedSizeHi"` PausedSizeMB int64 `json:"PausedSizeMB"` RemainingFileCount int64 `json:"RemainingFileCount"` RemainingParCount int64 `json:"RemainingParCount"` MaxPriority int64 `json:"MaxPriority"` ActiveDownloads int64 `json:"ActiveDownloads"` Status GroupStatus `json:"Status"` NZBName string `json:"NZBName"` Kind string `json:"Kind"` URL string `json:"URL"` NZBFilename string `json:"NZBFilename"` DestDir string `json:"DestDir"` FinalDir string `json:"FinalDir"` Category string `json:"Category"` ParStatus ParStatus `json:"ParStatus"` ExParStatus ExParStatus `json:"ExParStatus"` UnpackStatus UnpackStatus `json:"UnpackStatus"` MoveStatus MoveStatus `json:"MoveStatus"` ScriptStatus ScriptStatus `json:"ScriptStatus"` DeleteStatus DeleteStatus `json:"DeleteStatus"` MarkStatus MarkStatus `json:"MarkStatus"` URLStatus URLStatus `json:"UrlStatus"` FileSizeLo int64 `json:"FileSizeLo"` FileSizeHi int64 `json:"FileSizeHi"` FileSizeMB int64 `json:"FileSizeMB"` FileCount int64 `json:"FileCount"` MinPostTime Time `json:"MinPostTime"` MaxPostTime Time `json:"MaxPostTime"` TotalArticles int64 `json:"TotalArticles"` SuccessArticles int64 `json:"SuccessArticles"` FailedArticles int64 `json:"FailedArticles"` Health int64 `json:"Health"` CriticalHealth int64 `json:"CriticalHealth"` DupeScore int64 `json:"DupeScore"` DupeKey string `json:"DupeKey"` DupeMode string `json:"DupeMode"` DownloadedSizeLo int64 `json:"DownloadedSizeLo"` DownloadedSizeHi int64 `json:"DownloadedSizeHi"` DownloadedSizeMB int64 `json:"DownloadedSizeMB"` DownloadTimeSec int64 `json:"DownloadTimeSec"` PostTotalTimeSec int64 `json:"PostTotalTimeSec"` ParTimeSec int64 `json:"ParTimeSec"` RepairTimeSec int64 `json:"RepairTimeSec"` UnpackTimeSec int64 `json:"UnpackTimeSec"` MessageCount int64 `json:"MessageCount"` ExtraParBlocks int64 `json:"ExtraParBlocks"` Parameters []Parameter `json:"Parameters"` ScriptStatuses []PerScriptStatus `json:"ScriptStatuses"` ServerStats []ServerStats `json:"ServerStats"` PostInfoText string `json:"PostInfoText"` PostStageProgress int64 `json:"PostStageProgress"` PostStageTimeSec int64 `json:"PostStageTimeSec"` }
Group represents the listGroups RPC endpoint.
type GroupStatus ¶
type GroupStatus string
GroupStatus determines the current status of a download group.
const ( GroupQUEUED GroupStatus = "QUEUED" // queued for download; GroupPAUSED GroupStatus = "PAUSED" // paused; GroupDOWNLOADING GroupStatus = "DOWNLOADING" // item is being downloaded; GroupFETCHING GroupStatus = "FETCHING" // nzbGroupStatus = "" //file is being fetched from URL (Kind=URL); GroupPPQUEUED GroupStatus = "PP_QUEUED" // queued for postGroupStatus = "" //processing (completely downloaded); GroupLOADINGPARS GroupStatus = "LOADING_PARS" // stage of parGroupStatus = "" //check; GroupVERIFYINGSOURCES GroupStatus = "VERIFYING_SOURCES" // stage of parGroupStatus = "" //check; GroupREPAIRING GroupStatus = "REPAIRING" // stage of parGroupStatus = "" //check; GroupVERIFYINGREPAIRED GroupStatus = "VERIFYING_REPAIRED" // stage of parGroupStatus = "" //check; GroupRENAMING GroupStatus = "RENAMING" // processed by parGroupStatus = "" //renamer; GroupUNPACKING GroupStatus = "UNPACKING" // being unpacked; GroupMOVING GroupStatus = "MOVING" // moving files from intermediate directory into destination directory; GroupEXECUTINGSCRIPT GroupStatus = "EXECUTING_SCRIPT" // executing postGroupStatus = "" //processing script; GroupPPFINISHED GroupStatus = "PP_FINISHED" // postGroupStatus = "" //processing is finished, the item is about to be moved to history. )
GroupStatuses go here.
type History ¶
type History struct { NZBID int64 `json:"NZBID"` Name string `json:"Name"` RemainingFileCount int64 `json:"RemainingFileCount"` HistoryTime Time `json:"HistoryTime"` Status string `json:"Status"` NZBName string `json:"NZBName"` Kind string `json:"Kind"` URL string `json:"URL"` NZBFilename string `json:"NZBFilename"` DestDir string `json:"DestDir"` FinalDir string `json:"FinalDir"` Category string `json:"Category"` ParStatus ParStatus `json:"ParStatus"` ExParStatus ExParStatus `json:"ExParStatus"` UnpackStatus UnpackStatus `json:"UnpackStatus"` MoveStatus MoveStatus `json:"MoveStatus"` ScriptStatus ScriptStatus `json:"ScriptStatus"` DeleteStatus DeleteStatus `json:"DeleteStatus"` MarkStatus MarkStatus `json:"MarkStatus"` URLStatus URLStatus `json:"UrlStatus"` FileSizeLo int64 `json:"FileSizeLo"` FileSizeHi int64 `json:"FileSizeHi"` FileSizeMB int64 `json:"FileSizeMB"` FileCount int64 `json:"FileCount"` MinPostTime Time `json:"MinPostTime"` MaxPostTime Time `json:"MaxPostTime"` TotalArticles int64 `json:"TotalArticles"` SuccessArticles int64 `json:"SuccessArticles"` FailedArticles int64 `json:"FailedArticles"` Health int64 `json:"Health"` CriticalHealth int64 `json:"CriticalHealth"` DupeScore int64 `json:"DupeScore"` DupeKey string `json:"DupeKey"` DupeMode string `json:"DupeMode"` DownloadedSizeLo int64 `json:"DownloadedSizeLo"` DownloadedSizeHi int64 `json:"DownloadedSizeHi"` DownloadedSizeMB int64 `json:"DownloadedSizeMB"` DownloadTimeSec int64 `json:"DownloadTimeSec"` PostTotalTimeSec int64 `json:"PostTotalTimeSec"` ParTimeSec int64 `json:"ParTimeSec"` RepairTimeSec int64 `json:"RepairTimeSec"` UnpackTimeSec int64 `json:"UnpackTimeSec"` MessageCount int64 `json:"MessageCount"` ExtraParBlocks int64 `json:"ExtraParBlocks"` RetryData bool `json:"RetryData"` Parameters []Parameter `json:"Parameters"` ScriptStatuses []PerScriptStatus `json:"ScriptStatuses"` ServerStats []ServerStats `json:"ServerStats"` }
History represents the hisory RPC endpoint.
type LogEntry ¶
type LogEntry struct { ID int64 `json:"ID"` Time Time `json:"Time"` Kind LogKind `json:"Kind"` Text string `json:"Text"` }
LogEntry represents the log RPC endpoint.
type MarkStatus ¶
type MarkStatus string
MoveStatus determines if the download was marked by a user.
const ( MarkNONE MarkStatus = "NONE" // not marked; MarkGOOD MarkStatus = "GOOD" // the download was marked as good by user using command Mark as good in history dialog; MarkBAD MarkStatus = "BAD" // the download was marked as bad by user using command Mark as bad in history dialog; )
MarkStatuses go here.
type MoveStatus ¶
type MoveStatus string
MoveStatus determines the result of moving files from intermediate directory into final directory.
const ( MoveNONE MoveStatus = "NONE" // the moving wasn’t made because either the option InterDir is not in use or the par-check or unpack have failed; MoveSUCCESS MoveStatus = "SUCCESS" // files were moved successfully; MoveFAILURE MoveStatus = "FAILURE" // the moving has failed. )
MoveStatuses go here.
type NZBGet ¶
type NZBGet struct {
// contains filtered or unexported fields
}
NZBGet is what you get in return for passing in a valid Config to New().
func (*NZBGet) Append ¶ added in v0.1.1
func (n *NZBGet) Append(input *AppendInput) (int64, error)
Append adds a nzb-file or URL to the download queue. https://nzbget.net/api/append
func (*NZBGet) AppendContext ¶ added in v0.1.3
AppendContext adds a nzb-file or URL to the download queue. https://nzbget.net/api/append
func (*NZBGet) Config ¶
Config returns the loaded and active NZBGet configuration parameters. https://nzbget.net/api/config
func (*NZBGet) ConfigContext ¶ added in v0.1.3
ConfigContext returns the loaded and active NZBGet configuration parameters. https://nzbget.net/api/config
func (*NZBGet) ConfigTemplates ¶ added in v0.1.1
func (n *NZBGet) ConfigTemplates(loadFromDisk bool) ([]*ConfigTemplate, error)
ConfigTemplates returns NZBGet configuration file template and also extracts configuration sections from all post-processing files. This information is for example used by web-interface to build settings page or page “Postprocess” in download details dialog. https://nzbget.net/api/configtemplates
func (*NZBGet) ConfigTemplatesContext ¶ added in v0.1.3
func (n *NZBGet) ConfigTemplatesContext(ctx context.Context, loadFromDisk bool) ([]*ConfigTemplate, error)
ConfigTemplatesContext returns NZBGet configuration file template and also extracts configuration sections from all post-processing files. This information is for example used by web-interface to build settings page or page “Postprocess” in download details dialog. https://nzbget.net/api/configtemplates
func (*NZBGet) EditQueue ¶ added in v0.1.1
EditQueue edits items in download queue or in history. Read the official docs for how to issue commands, and which commands are available. https://nzbget.net/api/editqueue
func (*NZBGet) EditQueueContext ¶ added in v0.1.3
func (n *NZBGet) EditQueueContext(ctx context.Context, command, parameter string, ids []int64) (bool, error)
EditQueueContext edits items in download queue or in history. Read the official docs for how to issue commands, and which commands are available. https://nzbget.net/api/editqueue
func (*NZBGet) GetInto ¶
func (n *NZBGet) GetInto(ctx context.Context, method string, output interface{}, args ...interface{}) error
GetInto is a helper method to make a JSON-RPC request and turn the response into structured data.
func (*NZBGet) History ¶
History returns the NZBGet Download History. https://nzbget.net/api/history
func (*NZBGet) HistoryContext ¶ added in v0.1.3
HistoryContext returns the NZBGet Download History. https://nzbget.net/api/history
func (*NZBGet) ListFiles ¶
ListFiles returns the NZBGet Files for a download. https://nzbget.net/api/listfiles nzbID is the NZBID of the group to be returned. Use 0 for all file groups.
func (*NZBGet) ListFilesContext ¶ added in v0.1.3
ListFilesContext returns the NZBGet Files for a download. https://nzbget.net/api/listfiles nzbID is the NZBID of the group to be returned. Use 0 for all file groups.
func (*NZBGet) ListGroups ¶
ListGroups returns the NZBGet Download list. https://nzbget.net/api/listgroups
func (*NZBGet) ListGroupsContext ¶ added in v0.1.3
ListGroupsContext returns the NZBGet Download list. https://nzbget.net/api/listgroups
func (*NZBGet) LoadConfig ¶
LoadConfig returns the configuration from disk. https://nzbget.net/api/loadconfig
func (*NZBGet) LoadConfigContext ¶ added in v0.1.3
LoadConfigContext returns the configuration from disk. https://nzbget.net/api/loadconfig
func (*NZBGet) LoadLog ¶
LoadLog returns the NZBGet log for a specific download. NOTE: only one of either startID or limit - can be specified. The other parameter must be 0. https://nzbget.net/api/loadlog
func (*NZBGet) LoadLogContext ¶ added in v0.1.3
func (n *NZBGet) LoadLogContext(ctx context.Context, nzbID, startID, limit int64) ([]*LogEntry, error)
LoadLogContext returns the NZBGet log for a specific download. NOTE: only one of either startID or limit - can be specified. The other parameter must be 0. https://nzbget.net/api/loadlog
func (*NZBGet) Log ¶
Log returns the NZBGet Logs. NOTE: only one parameter - either startID or limit - can be specified. The other parameter must be 0. https://nzbget.net/api/log
func (*NZBGet) LogContext ¶ added in v0.1.3
LogContext returns the NZBGet Logs. NOTE: only one parameter - either startID or limit - can be specified. The other parameter must be 0. https://nzbget.net/api/log
func (*NZBGet) PauseDownload ¶
PauseDownload pauses downloads. https://nzbget.net/api/pausedownload
func (*NZBGet) PauseDownloadContext ¶ added in v0.1.3
PauseDownloadContext pauses downloads. https://nzbget.net/api/pausedownload
func (*NZBGet) PausePost ¶
PausePost pauses post processing. https://nzbget.net/api/pausepost
func (*NZBGet) PausePostContext ¶ added in v0.1.3
PausePostContext pauses post processing. https://nzbget.net/api/pausepost
func (*NZBGet) PauseScan ¶
PauseScan pauses scanning of directory with incoming nzb-files. https://nzbget.net/api/pausescan
func (*NZBGet) PauseScanContext ¶ added in v0.1.3
PauseScanContext pauses scanning of directory with incoming nzb-files. https://nzbget.net/api/pausescan
func (*NZBGet) Rate ¶
Rate sets download speed limit. https://nzbget.net/api/rate
func (*NZBGet) RateContext ¶ added in v0.1.3
RateContext sets download speed limit. https://nzbget.net/api/rate
func (*NZBGet) Reload ¶
Reload makes NZBGet stop all activities and reinitialize. https://nzbget.net/api/reload
func (*NZBGet) ReloadContext ¶ added in v0.1.3
ReloadContext makes NZBGet stop all activities and reinitialize. https://nzbget.net/api/reload
func (*NZBGet) ResetServerVolume ¶ added in v0.1.1
ResetServerVolume resets download volume statistics for a specified news-server. https://nzbget.net/api/resetservervolume
func (*NZBGet) ResetServerVolumeContext ¶ added in v0.1.3
func (n *NZBGet) ResetServerVolumeContext(ctx context.Context, serverID int64, sounter string) (bool, error)
ResetServerVolumeContext resets download volume statistics for a specified news-server. https://nzbget.net/api/resetservervolume
func (*NZBGet) ResumeDownload ¶
ResumeDownload resumes downloads. https://nzbget.net/api/resumedownload
func (*NZBGet) ResumeDownloadContext ¶ added in v0.1.3
ResumeDownloadContext resumes downloads. https://nzbget.net/api/resumedownload
func (*NZBGet) ResumePost ¶
ResumePost resumes post processing. https://nzbget.net/api/resumepost
func (*NZBGet) ResumePostContext ¶ added in v0.1.3
ResumePostContext resumes post processing. https://nzbget.net/api/resumepost
func (*NZBGet) ResumeScan ¶
ResumeScan resumes scanning of directory with incoming nzb-files. https://nzbget.net/api/resumescan
func (*NZBGet) ResumeScanContext ¶ added in v0.1.3
ResumeScanContext resumes scanning of directory with incoming nzb-files. https://nzbget.net/api/resumescan
func (*NZBGet) SaveConfig ¶
SaveConfig writes new configuration parameters to disk. https://nzbget.net/api/saveconfig
func (*NZBGet) SaveConfigContext ¶ added in v0.1.3
SaveConfigContext writes new configuration parameters to disk. https://nzbget.net/api/saveconfig
func (*NZBGet) Scan ¶
Scan requests rescanning of incoming directory for nzb-files. https://nzbget.net/api/scheduleresume
func (*NZBGet) ScanContext ¶ added in v0.1.3
ScanContext requests rescanning of incoming directory for nzb-files. https://nzbget.net/api/scheduleresume
func (*NZBGet) ScheduleResume ¶
ScheduleResume schedules resuming of all activities after wait duration elapses. Wait duration is rounded to nearest second. https://nzbget.net/api/scheduleresume
func (*NZBGet) ScheduleResumeContext ¶ added in v0.1.3
ScheduleResumeContext schedules resuming of all activities after wait duration elapses. Wait duration is rounded to nearest second. https://nzbget.net/api/scheduleresume
func (*NZBGet) ServerVolumes ¶ added in v0.1.1
func (n *NZBGet) ServerVolumes() ([]*ServerVolume, error)
ServerVolumes returns download volume statistics per news-server. https://nzbget.net/api/servervolumes NOTE: The first record (serverid=0) are totals for all servers.
func (*NZBGet) ServerVolumesContext ¶ added in v0.1.3
func (n *NZBGet) ServerVolumesContext(ctx context.Context) ([]*ServerVolume, error)
ServerVolumesContext returns download volume statistics per news-server. https://nzbget.net/api/servervolumes NOTE: The first record (serverid=0) are totals for all servers.
func (*NZBGet) Shutdown ¶
Shutdown makes NZBGet exit. https://nzbget.net/api/shutdown
func (*NZBGet) ShutdownContext ¶ added in v0.1.3
ShutdownContext makes NZBGet exit. https://nzbget.net/api/shutdown
func (*NZBGet) Status ¶
Status returns the NZBGet Status. https://nzbget.net/api/status
func (*NZBGet) StatusContext ¶ added in v0.1.3
StatusContext returns the NZBGet Status. https://nzbget.net/api/status
func (*NZBGet) Version ¶
Version returns the NZBGet Version. https://nzbget.net/api/version
func (*NZBGet) VersionContext ¶ added in v0.1.3
VersionContext returns the NZBGet Version. https://nzbget.net/api/version
func (*NZBGet) WriteLog ¶
WriteLog appends a log entry to th server's log and on-screen log buffer. https://nzbget.net/api/writelog
func (*NZBGet) WriteLogContext ¶ added in v0.1.3
WriteLogContext appends a log entry to th server's log and on-screen log buffer. https://nzbget.net/api/writelog
type NewsServers ¶
NewsServers is part of the Status endpoint output.
type ParStatus ¶
type ParStatus string
ParStatus determines the result of par-check/repair.
const ( ParNONE ParStatus = "NONE" // par-check wasn’t performed; ParFAILURE ParStatus = "FAILURE" // par-check has failed; ParREPAIRPOSSIBLE ParStatus = "REPAIR_POSSIBLE" // download is damaged, additional par-files were downloaded but the download was not repaired. Either the option ParRepair is disabled or the par-repair was cancelled by option ParTimeLimit; ParSUCCESS ParStatus = "SUCCESS" // par-check was successful; ParMANUAL ParStatus = "MANUAL" // download is damaged but was not checked/repaired because option ParCheck is set to Manual. )
ParStatuses go here.
type PerScriptStatus ¶
type PerScriptStatus struct { Name string `json:"Name"` Status ScriptStatus `json:"Status"` }
PerScriptStatus is part of the history endpoint output.
type ScriptStatus ¶
type ScriptStatus string
ScriptStatus determines the result of a post-processing script.
const ( ScriptNONE ScriptStatus = "NONE" ScriptFAILURE ScriptStatus = "FAILURE" ScriptSUCCESS ScriptStatus = "SUCCESS" )
ScriptStatuses go here.
type ServerStats ¶
type ServerStats struct { ServerID int64 `json:"ServerID"` SuccessArticles int64 `json:"SuccessArticles"` FailedArticles int64 `json:"FailedArticles"` }
ServerStats is part of a few endpoints output.
type ServerVolume ¶ added in v0.1.1
type ServerVolume struct { ServerID int64 `json:"ServerID"` // ID of news server. DataTime Time `json:"DataTime"` // Date/time when the data was last updated (time is in C/Unix format). TotalSizeLo int64 `json:"TotalSizeLo"` // Total amount of downloaded data since program installation, low 32-bits of 64-bit value. TotalSizeHi int64 `json:"TotalSizeHi"` // Total amount of downloaded data since program installation, high 32-bits of 64-bit value. TotalSizeMB int64 `json:"TotalSizeMB"` // Total amount of downloaded data since program installation, in megabytes. CustomSizeLo int64 `json:"CustomSizeLo"` // Amount of downloaded data since last reset of custom counter, low 32-bits of 64-bit value. CustomSizeHi int64 `json:"CustomSizeHi"` // Amount of downloaded data since last reset of custom counter, high 32-bits of 64-bit value. CustomSizeMB int64 `json:"CustomSizeMB"` // Amount of downloaded data since last reset of custom counter, in megabytes. CustomTime Time `json:"CustomTime"` // Date/time of the last reset of custom counter (time is in C/Unix format). BytesPerSeconds []BytesPer `json:"BytesPerSeconds"` // Per-second amount of data downloaded in last 60 seconds. See below. BytesPerMinutes []BytesPer `json:"BytesPerMinutes"` // Per-minute amount of data downloaded in last 60 minutes. See below. BytesPerHours []BytesPer `json:"BytesPerHours"` // Per-hour amount of data downloaded in last 24 hours. See below. BytesPerDays []BytesPer `json:"BytesPerDays"` // Per-day amount of data downloaded since program installation. See below. SecSlot int64 `json:"SecSlot"` // The current second slot of field BytesPerSeconds the program writes into. MinSlot int64 `json:"MinSlot"` // The current minute slot of field BytesPerMinutes the program writes into. HourSlot int64 `json:"HourSlot"` // The current hour slot of field BytesPerHours the program writes into. DaySlot int64 `json:"DaySlot"` // The current day slot of field BytesPerDays the program writes into. FirstDay int64 `json:"FirstDay"` // Indicates which calendar day the very first slot of BytesPerDays corresponds to. Details see below. }
ServerVolume represents the servervolumes RPC endpoint output.
type Status ¶
type Status struct { RemainingSizeLo int64 `json:"RemainingSizeLo"` RemainingSizeHi int64 `json:"RemainingSizeHi"` RemainingSizeMB int64 `json:"RemainingSizeMB"` ForcedSizeLo int64 `json:"ForcedSizeLo"` ForcedSizeHi int64 `json:"ForcedSizeHi"` ForcedSizeMB int64 `json:"ForcedSizeMB"` DownloadedSizeLo int64 `json:"DownloadedSizeLo"` DownloadedSizeHi int64 `json:"DownloadedSizeHi"` DownloadedSizeMB int64 `json:"DownloadedSizeMB"` MonthSizeLo int64 `json:"MonthSizeLo"` MonthSizeHi int64 `json:"MonthSizeHi"` MonthSizeMB int64 `json:"MonthSizeMB"` DaySizeLo int64 `json:"DaySizeLo"` DaySizeHi int64 `json:"DaySizeHi"` DaySizeMB int64 `json:"DaySizeMB"` ArticleCacheLo int64 `json:"ArticleCacheLo"` ArticleCacheHi int64 `json:"ArticleCacheHi"` ArticleCacheMB int64 `json:"ArticleCacheMB"` DownloadRate int64 `json:"DownloadRate"` AverageDownloadRate int64 `json:"AverageDownloadRate"` DownloadLimit int64 `json:"DownloadLimit"` ThreadCount int64 `json:"ThreadCount"` PostJobCount int64 `json:"PostJobCount"` URLCount int64 `json:"UrlCount"` UpTimeSec int64 `json:"UpTimeSec"` DownloadTimeSec int64 `json:"DownloadTimeSec"` FreeDiskSpaceLo int64 `json:"FreeDiskSpaceLo"` FreeDiskSpaceHi int64 `json:"FreeDiskSpaceHi"` FreeDiskSpaceMB int64 `json:"FreeDiskSpaceMB"` ServerTime Time `json:"ServerTime"` ResumeTime Time `json:"ResumeTime"` QueueScriptCount int64 `json:"QueueScriptCount"` FeedActive bool `json:"FeedActive"` DownloadPaused bool `json:"DownloadPaused"` ServerStandBy bool `json:"ServerStandBy"` PostPaused bool `json:"PostPaused"` ScanPaused bool `json:"ScanPaused"` QuotaReached bool `json:"QuotaReached"` NewsServers []NewsServers `json:"NewsServers"` }
Status represents the status RPC endpoint.
type Time ¶
Time defines a timestamp encoded as epoch seconds in JSON. NZBGet returns all times as seconds since epoch, so we use a custom type to always return a proper go Time.
func (Time) MarshalJSON ¶
MarshalJSON is used to convert the timestamp to JSON.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON is used to convert the timestamp from JSON.
type URLStatus ¶
type URLStatus string
URLStatus determines the result of the URL download.
const ( URLNONE URLStatus = "NONE" // that nzb-file were not fetched from an URL; URLSUCCESS URLStatus = "SUCCESS" // that nzb-file was fetched from an URL; URLFAILURE URLStatus = "FAILURE" // the fetching of the URL has failed. URLSCANSKIPPED URLStatus = "SCAN_SKIPPED" // The URL was fetched successfully but downloaded file was not nzb-file and was skipped by the scanner; URLSCANFAILURE URLStatus = "SCAN_FAILURE" // The URL was fetched successfully but an error occurred during scanning of the downloaded file. The downloaded file isn’t a proper nzb-file. This status usually means the web-server has returned an error page (HTML page) instead of the nzb-file. )
URLStatuses go here.
type UnpackStatus ¶
type UnpackStatus string
UnpackStatus determines the result of the unpack extraction.
const ( UnpackNONE UnpackStatus = "NONE" // unpack wasn’t performed, either no archive files were found or the unpack is disabled for that download or globally; UnpackFAILURE UnpackStatus = "FAILURE" // unpack has failed; UnpackSPACE UnpackStatus = "SPACE" // unpack has failed due to not enough disk space; UnpackPASSWORD UnpackStatus = "PASSWORD" // unpack has failed because the password was not provided or was wrong. Only for rar5-archives; UnpackSUCCESS UnpackStatus = "SUCCESS" // unpack was successful. )
UnpackStatuses go here.