Documentation
¶
Index ¶
- type BuiltinLogger
- func (l *BuiltinLogger) Debug(args ...interface{})
- func (l *BuiltinLogger) Debugf(format string, args ...interface{})
- func (l *BuiltinLogger) Error(args ...interface{})
- func (l *BuiltinLogger) Errorf(format string, args ...interface{})
- func (l *BuiltinLogger) Fatal(args ...interface{})
- func (l *BuiltinLogger) Fatalf(format string, args ...interface{})
- func (l *BuiltinLogger) Info(args ...interface{})
- func (l *BuiltinLogger) Infof(format string, args ...interface{})
- func (l *BuiltinLogger) Warn(args ...interface{})
- func (l *BuiltinLogger) Warnf(format string, args ...interface{})
- type Logger
- type Req
- func (r *Req) Delete() (*Response, error)
- func (r *Req) Get() (*Response, error)
- func (r *Req) Post() (*Response, error)
- func (r *Req) PostJSON() (*Response, error)
- func (r *Req) Put() (*Response, error)
- func (r *Req) SetBody(data []byte) *Req
- func (r *Req) SetBodyXML() *Req
- func (r *Req) SetContentType(contentType string) *Req
- func (r *Req) SetCookie(c *http.Cookie) *Req
- func (r *Req) SetForm(files []map[string]string, fields []map[string]string) *Req
- func (r *Req) SetHeaders(headers map[string]string) *Req
- func (r *Req) SetParam(param, value string) *Req
- func (r *Req) SetParams(queryParams map[string]string) *Req
- func (r *Req) SetProxy(u string) *Req
- func (r *Req) SetTLSConfig(c *tls.Config) *Req
- func (r *Req) SetTimeout(d time.Duration) *Req
- func (r *Req) SetTransport(transport *http.Transport) *Req
- type Response
- func (r *Response) Body() ([]byte, error)
- func (r *Response) Close() error
- func (r *Response) DownloadFile(downloadDir string) (contentType string, filePath string, err error)
- func (r *Response) Headers() http.Header
- func (r *Response) Response() *http.Response
- func (r *Response) SaveFile(filePath string) error
- func (r *Response) StatusCode() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuiltinLogger ¶
type BuiltinLogger struct {
// contains filtered or unexported fields
}
func NewBuiltinLogger ¶
func NewBuiltinLogger() *BuiltinLogger
func (*BuiltinLogger) Debug ¶
func (l *BuiltinLogger) Debug(args ...interface{})
func (*BuiltinLogger) Debugf ¶
func (l *BuiltinLogger) Debugf(format string, args ...interface{})
func (*BuiltinLogger) Error ¶
func (l *BuiltinLogger) Error(args ...interface{})
func (*BuiltinLogger) Errorf ¶
func (l *BuiltinLogger) Errorf(format string, args ...interface{})
func (*BuiltinLogger) Fatal ¶
func (l *BuiltinLogger) Fatal(args ...interface{})
func (*BuiltinLogger) Fatalf ¶
func (l *BuiltinLogger) Fatalf(format string, args ...interface{})
func (*BuiltinLogger) Info ¶
func (l *BuiltinLogger) Info(args ...interface{})
func (*BuiltinLogger) Infof ¶
func (l *BuiltinLogger) Infof(format string, args ...interface{})
func (*BuiltinLogger) Warn ¶
func (l *BuiltinLogger) Warn(args ...interface{})
func (*BuiltinLogger) Warnf ¶
func (l *BuiltinLogger) Warnf(format string, args ...interface{})
type Logger ¶
type Logger interface { Debug(args ...interface{}) Debugf(format string, args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Warn(args ...interface{}) Warnf(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) }
type Req ¶
Req is main struct for requests
func (*Req) SetContentType ¶
SetContentType sets content type of request
func (*Req) SetHeaders ¶
SetHeaders sets request headers
func (*Req) SetTLSConfig ¶
SetTLSConfig changes the request TLS client configuration
func (*Req) SetTimeout ¶
SetTimeout changes the request timeout
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response is the main struct which holds the http.Response and data.
func (*Response) DownloadFile ¶
func (r *Response) DownloadFile(downloadDir string) (contentType string, filePath string, err error)
DownloadFile looks for Content-Disposition header to find the filename attribute and returns the content-type header with saved file path that is saved under given downloadDir.
func (*Response) StatusCode ¶
StatusCode returns the status code of the response
Click to show internal directories.
Click to hide internal directories.