Documentation
¶
Index ¶
Constants ¶
const ( PriorityDefault = "-100" // Default priority PriorityPaused = "-2" // Paused download PriorityLow = "-1" // Low priority PriorityNormal = "0" // Normal priority PriorityHigh = "1" // High priority PriorityForce = "2" // Force priority )
Priority constants for SABnzbd downloads
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SABnzbdAPIResponse ¶
type SABnzbdAPIResponse struct {
Status bool `json:"status"`
Error *string `json:"error,omitempty"`
NzoIds []string `json:"nzo_ids,omitempty"`
}
SABnzbdAPIResponse represents a response from SABnzbd API
type SABnzbdClient ¶
type SABnzbdClient struct {
// contains filtered or unexported fields
}
SABnzbdClient handles communication with external SABnzbd instances
func NewSABnzbdClient ¶
func NewSABnzbdClient(httpClient *http.Client) *SABnzbdClient
NewSABnzbdClient creates a new SABnzbd client. The supplied httpClient carries the desired Timeout + proxy Transport — typically built via httpclient.NewForExternal so outbound requests respect the configured proxy. When nil, a no-proxy 60s client is used.
func (*SABnzbdClient) SendNZBContent ¶ added in v0.3.0
func (c *SABnzbdClient) SendNZBContent(ctx context.Context, host, apiKey string, nzbXML []byte, filename string, category *string, priority *string) (string, error)
SendNZBContent sends raw NZB XML bytes to a SABnzbd host. Returns the NZO ID assigned by SABnzbd, or an error. Priority values: "-100" (default), "-2" (paused), "-1" (low), "0" (normal), "1" (high), "2" (force)
func (*SABnzbdClient) SendNZBFile ¶
func (c *SABnzbdClient) SendNZBFile(ctx context.Context, host, apiKey, nzbPath string, category *string, priority *string) (string, error)
SendNZBFile sends an NZB file to an external SABnzbd instance Returns the NZO ID assigned by SABnzbd, or an error Priority values: "-100" (default), "-2" (paused), "-1" (low), "0" (normal), "1" (high), "2" (force)