Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultUserAgent = "Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0" ErrUnsupportedContentType = UnsupportedContentTypeError{ HttpError{ StatusCode: http.StatusUnsupportedMediaType, Status: http.StatusText(http.StatusUnsupportedMediaType), Message: "Unsupported content type", }, } )
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory func() (URLFetcher, error)
type FeedFetcher ¶ added in v0.6.3
type HttpError ¶ added in v0.6.3
func NewHTTPError ¶
TODO: Resolve/make consistent the pointer/value semantics of this and other errors here.
func (HttpError) Is ¶ added in v0.6.3
We consider the Is test true if the target is an HttpError. For further resolution, check the StatusCode field of the error. TODO: The idea of providing generic and specific HTTPErors is well-intentioned, but the Is checks are a bit baroque (because to make sense these need to work bidrectionally). Consider simplifying.
type URLFetcher ¶ added in v0.6.3
type UnsupportedContentTypeError ¶
type UnsupportedContentTypeError struct {
HttpError
}
func NewUnsupportedContentTypeError ¶
func NewUnsupportedContentTypeError(contentType string) *UnsupportedContentTypeError
func (UnsupportedContentTypeError) Is ¶
func (e UnsupportedContentTypeError) Is(target error) bool
Makes errors.Is(err, ErrUnsupportedContentType) return true for any instance of UnsupportedContentTypeError or for an HttpError with a 415 status code.
Click to show internal directories.
Click to hide internal directories.