Documentation
¶
Overview ¶
Package downloader contains the common code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DownloadHandlers = []Downloader{
downloadCover,
downloadAudiobook,
downloadBook,
downloadDemo,
downloadPhotos,
}
DownloadHandlers list of handlers used.
Functions ¶
func CheckRedirect ¶
CheckRedirect custom cycle redirect error.
func CheckResponse ¶
CheckResponse returns an error (of type *Error) if the response status code is not 2xx.
Types ¶
type Downloader ¶
Downloader type for handlers.
type Error ¶
type Error struct {
// Code is the HTTP response status code and will always be populated.
Code int `json:"code"`
// Message is the server response message and is only populated when
// explicitly referenced by the JSON server response.
Message string `json:"message"`
// Body is the raw response returned by the server.
// It is often but not always JSON, depending on how the request fails.
Body string
// Header contains the response header fields from the server.
Header http.Header
Errors []ErrorItem
}
Error contains an error response from the server.
type ErrorItem ¶
type ErrorItem struct {
// Reason is the typed error code. For example: "some_example".
Reason string `json:"reason"`
// Message is the human-readable description of the error.
Message string `json:"message"`
}
ErrorItem is a detailed error code & message from the Google API frontend.
Click to show internal directories.
Click to hide internal directories.