Versions in this module Expand all Collapse all v0 v0.2.0 Aug 30, 2022 Changes in this version + const DefaultReadLimit + const DefaultTimeout + const IANA + var DefaultAdapter = &defaultAdapter + var DefaultClient = NewClient(DefaultTimeout) + var ErrURLNotSupported = errors.New("URL not supported") + func BindAdapter(s Adapter, names ...string) + func Server(query string) (string, string, error) + type Adapter interface + Prepare func(*Request) error + Text func(*Response) ([]byte, error) + type Client struct + Dial func(string, string) (net.Conn, error) + DialContext func(context.Context, string, string) (net.Conn, error) + HTTPClient *http.Client + Timeout time.Duration + func NewClient(timeout time.Duration) *Client + func (c *Client) Fetch(req *Request) (*Response, error) + func (c *Client) FetchContext(ctx context.Context, req *Request) (*Response, error) + type FetchError struct + Err error + Host string + func (f *FetchError) Error() string + type Record struct + type Request struct + Body []byte + Host string + Query string + URL string + func NewRequest(query string) (*Request, error) + func (req *Request) Adapter() Adapter + func (req *Request) Prepare() error + type Response struct + Body []byte + Charset string + FetchedAt time.Time + Host string + MediaType string + Query string + func Fetch(query string) (*Response, error) + func NewResponse(query, host string) *Response + func ReadMIME(r io.Reader) (*Response, error) + func ReadMIMEFile(path string) (*Response, error) + func (res *Response) Adapter() Adapter + func (res *Response) Checksum() string + func (res *Response) ContentType() string + func (res *Response) DetectCharset() + func (res *Response) DetectContentType(ct string) + func (res *Response) Encoding() (encoding.Encoding, error) + func (res *Response) Header() http.Header + func (res *Response) Reader() (io.Reader, error) + func (res *Response) String() string + func (res *Response) Text() ([]byte, error) + func (res *Response) WriteMIME(w io.Writer) error