Documentation
¶
Index ¶
- Variables
- func CreateFormFile(w *multipart.Writer, fieldname, filename string, contentType ...string) (io.Writer, error)
- func MustOpen(f string) *os.File
- type ClientOptions
- type LeveledLogger
- type Logger
- type Request
- func (r *Request) AttachFile(reader io.Reader, contentType ...string) *Request
- func (r *Request) AttachFiles(files map[string][]interface{}) *Request
- func (r *Request) Connect(uri string) *Response
- func (r *Request) Cookies() (out []*http.Cookie)
- func (r *Request) Delete(uri string, headers ...http.Header) *Response
- func (r *Request) Do(method string, uri string, headers ...http.Header) *Response
- func (r *Request) Error() error
- func (r *Request) Get(uri string, headers ...http.Header) *Response
- func (r *Request) Head(uri string) *Response
- func (r *Request) Headers() (out http.Header)
- func (r *Request) JSON(data interface{}) *Request
- func (r *Request) Json(data interface{}) *Request
- func (r *Request) Options(uri string) *Response
- func (r *Request) Patch(uri string, headers ...http.Header) *Response
- func (r *Request) Post(uri string, headers ...http.Header) *Response
- func (r *Request) Put(uri string, headers ...http.Header) *Response
- func (r *Request) SetCookies(cookies ...*http.Cookie) *Request
- func (r *Request) Trace(uri string) *Response
- func (r *Request) With(params *url.Values, data *url.Values) *Request
- func (r *Request) WithFile(reader io.Reader) *Request
- func (r *Request) WithForm(data *url.Values) *Request
- func (r *Request) WithQuery(params *url.Values) *Request
- type Response
- func (resp *Response) Charset(contentTypes ...string) (charset string)
- func (resp *Response) Content() []byte
- func (resp *Response) ContentType(contentTypes ...string) (mime, charset string)
- func (resp *Response) DetectCodePage() string
- func (resp *Response) Error() error
- func (resp *Response) Headers() http.Header
- func (resp *Response) JSON() (data map[string]interface{})
- func (resp *Response) Json() (data map[string]interface{})
- func (resp *Response) Mime(contentTypes ...string) (mime string)
- func (resp *Response) NewReader() (reader io.Reader)
- func (resp *Response) Text() string
- type StandardClient
- func (client *StandardClient) Cookies(host string) []*http.Cookie
- func (client *StandardClient) Error() error
- func (cl *StandardClient) LLog() LeveledLogger
- func (cl *StandardClient) Log() Logger
- func (cl *StandardClient) SLog() StandardLogger
- func (client *StandardClient) SetCookies(host string, cookies ...*http.Cookie) *StandardClient
- func (client *StandardClient) With(options ...interface{}) *StandardClient
- func (client *StandardClient) WithJar(jar http.CookieJar) *StandardClient
- func (client *StandardClient) WithLogger(logger Logger) *StandardClient
- func (client *StandardClient) WithTimeout(timeout time.Duration) *StandardClient
- func (client *StandardClient) WithTransport(transport http.RoundTripper) *StandardClient
- type StandardLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorEmptyListValues = errors.New("An empty list of values is passed to create multipart content")
Functions ¶
func CreateFormFile ¶ added in v0.2.0
Types ¶
type ClientOptions ¶
type ClientOptions map[string]interface{}
func (*ClientOptions) Merge ¶
func (opt *ClientOptions) Merge(other ClientOptions)
type LeveledLogger ¶ added in v0.2.1
type Request ¶
func NewRequest ¶
func NewRequest(client *StandardClient) *Request
func (*Request) AttachFile ¶
func (*Request) AttachFiles ¶
type Response ¶
func (*Response) ContentType ¶ added in v0.2.0
func (*Response) DetectCodePage ¶ added in v0.2.0
type StandardClient ¶ added in v0.2.0
type StandardClient struct { *http.Client Logger interface{} // contains filtered or unexported fields }
func Cleaned ¶ added in v0.2.0
func Cleaned() (cl *StandardClient)
func Default ¶ added in v0.2.0
func Default() (cl *StandardClient)
func NewClient ¶
func NewClient(clients ...*http.Client) (cl *StandardClient)
func Pooled ¶ added in v0.2.0
func Pooled() (cl *StandardClient)
func (*StandardClient) Cookies ¶ added in v0.2.0
func (client *StandardClient) Cookies(host string) []*http.Cookie
func (*StandardClient) Error ¶ added in v0.2.0
func (client *StandardClient) Error() error
func (*StandardClient) LLog ¶ added in v0.2.1
func (cl *StandardClient) LLog() LeveledLogger
func (*StandardClient) Log ¶ added in v0.2.1
func (cl *StandardClient) Log() Logger
func (*StandardClient) SLog ¶ added in v0.2.1
func (cl *StandardClient) SLog() StandardLogger
func (*StandardClient) SetCookies ¶ added in v0.2.0
func (client *StandardClient) SetCookies( host string, cookies ...*http.Cookie) *StandardClient
func (*StandardClient) With ¶ added in v0.2.0
func (client *StandardClient) With(options ...interface{}) *StandardClient
func (*StandardClient) WithJar ¶ added in v0.2.0
func (client *StandardClient) WithJar(jar http.CookieJar) *StandardClient
func (*StandardClient) WithLogger ¶ added in v0.2.1
func (client *StandardClient) WithLogger(logger Logger) *StandardClient
func (*StandardClient) WithTimeout ¶ added in v0.2.0
func (client *StandardClient) WithTimeout( timeout time.Duration) *StandardClient
func (*StandardClient) WithTransport ¶ added in v0.2.0
func (client *StandardClient) WithTransport( transport http.RoundTripper) *StandardClient
type StandardLogger ¶ added in v0.2.1
type StandardLogger interface { Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) Fatalln(v ...interface{}) Flags() int Output(calldepth int, s string) error Panic(v ...interface{}) Panicf(format string, v ...interface{}) Panicln(v ...interface{}) Prefix() string Print(v ...interface{}) Printf(format string, v ...interface{}) Println(v ...interface{}) SetFlags(flag int) SetOutput(w io.Writer) SetPrefix(prefix string) Writer() io.Writer }
Click to show internal directories.
Click to hide internal directories.