Documentation ¶
Index ¶
- func GetFileDocument(filePath string) (*goquery.Document, error)
- func HTTPGet(url string) (*goquery.Document, error)
- func HTTPGetJSON(url string, resp interface{}) error
- func HTTPPost(url string, req interface{}, resp interface{}) error
- func NormalizeMediaTitle(title string) string
- func NormalizeQuery(query string) string
- type GoirateLogger
- type HTTPClient
- type OptionalBoolean
- type WatchlistActions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileDocument ¶
GetFileDocument opens an HTML file and returns a GoQuery document from that file.
func HTTPGet ¶
HTTPGet fetches an HTTP url and returns a goquery.Document. It will also set the appropriate headers to make sure the pages are returned in English.
func HTTPGetJSON ¶
HTTPGetJSON fetches an HTTP url and deserializes the JSON response into resp. It will also set the appropriate headers to make sure the pages are returned in English.
func HTTPPost ¶
HTTPPost executes an HTTP post request on the given url by serializing the given object into JSON.
func NormalizeMediaTitle ¶
NormalizeMediaTitle removes any parts of the title that are in brackets or parentheses.
func NormalizeQuery ¶
NormalizeQuery will appropriate replace special characters in a title as to normalize it for better comparisons.
Types ¶
type GoirateLogger ¶ added in v0.13.1
type GoirateLogger struct { }
GoirateLogger acts as a logger for filtering certain types of problematic output. Main case is forms of "Unsolicited response received on idle HTTP channel", which Go for some reason thinks is a good idea to dump straight into stdout...
type HTTPClient ¶
type HTTPClient struct { // Timeout is the time limit for requests. Timeout time.Duration AuthToken string }
HTTPClient holds parameters for performing HTTP requests in the library.
func (*HTTPClient) Get ¶
func (c *HTTPClient) Get(urlString string) (*goquery.Document, error)
Get fetches an HTTP url and returns a goquery.Document. It will also set the appropriate headers to make sure the pages are returned in English.
func (*HTTPClient) GetJSON ¶
func (c *HTTPClient) GetJSON(url string, resp interface{}) error
GetJSON executes an HTTP get request on the given url by serializing the given object into JSON.
func (*HTTPClient) Post ¶
func (c *HTTPClient) Post(url string, req interface{}, resp interface{}) error
Post executes an HTTP post request on the given url by serializing the given object into JSON.
type OptionalBoolean ¶
type OptionalBoolean string
OptionalBoolean defines a boolean constant that can also be undefined.
const ( // Default represents an undefined value. Default OptionalBoolean = "" // True represents a positive value. True OptionalBoolean = "true" // False represents a negative value. False OptionalBoolean = "false" )
func (OptionalBoolean) OverridenBy ¶
func (opt OptionalBoolean) OverridenBy(other OptionalBoolean) bool
OverridenBy returns true if one of this or the other action is true, or if the other action is true.
type WatchlistActions ¶
type WatchlistActions struct { SendEmail OptionalBoolean `toml:"email" json:"email"` Emails []string `toml:"notify" json:"notify"` Download OptionalBoolean `toml:"download" json:"download"` }
WatchlistActions defines actions to be taken upon discovering a new torrent, along with any parameters regarding said action.