Documentation
¶
Index ¶
- type Session
- type UseWaybackMachineError
- type WaybackMachineWrapper
- func (s *WaybackMachineWrapper) ApplyRateLimit()
- func (w *WaybackMachineWrapper) Get(uri string) (response *http.Response, err error)
- func (s *WaybackMachineWrapper) GetDocument(response *http.Response) *goquery.Document
- func (s *WaybackMachineWrapper) Post(uri string, data url.Values) (response *http.Response, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session interface { Get(uri string) (response *http.Response, err error) Post(uri string, data url.Values) (response *http.Response, err error) GetDocument(response *http.Response) *goquery.Document ApplyRateLimit() }
Session is the interface for the implemented HTTP client
func NewSession ¶
func NewSession(novelConfig *config.NovelConfig) Session
NewSession initializes a new session and sets all the required headers etc
type UseWaybackMachineError ¶
type UseWaybackMachineError struct { Handling *config.WaybackMachine URL *url.URL // contains filtered or unexported fields }
UseWaybackMachineError custom error if we get redirected on a URL configured to use the wayback machine
type WaybackMachineWrapper ¶
type WaybackMachineWrapper struct {
// contains filtered or unexported fields
}
WaybackMachineWrapper contains wayback machine related variables like the session and the novel configuration
func (*WaybackMachineWrapper) ApplyRateLimit ¶
func (s *WaybackMachineWrapper) ApplyRateLimit()
ApplyRateLimit waits for the leaky bucket to fill again
func (*WaybackMachineWrapper) Get ¶
func (w *WaybackMachineWrapper) Get(uri string) (response *http.Response, err error)
Get performs a normal GET request but checks the redirects to a host which should use the wayback machine
func (*WaybackMachineWrapper) GetDocument ¶
GetDocument converts the http response to a *goquery.Document
Click to show internal directories.
Click to hide internal directories.