Documentation
¶
Index ¶
- func SetBaseURL(baseURL string)
- type Auth
- type Client
- type DefaultLogger
- type InterceptorOptions
- type LogLevel
- type LogOptions
- type Logger
- type ProgressReader
- type ProgressWriter
- type Promise
- func DeleteAsync(urlStr string, options ...*RequestOptions) *Promise
- func GetAsync(urlStr string, options ...*RequestOptions) *Promise
- func HeadAsync(urlStr string, options ...*RequestOptions) *Promise
- func NewPromise() *Promise
- func OptionsAsync(urlStr string, options ...*RequestOptions) *Promise
- func PatchAsync(urlStr string, body interface{}, options ...*RequestOptions) *Promise
- func PostAsync(urlStr string, body interface{}, options ...*RequestOptions) *Promise
- func PutAsync(urlStr string, body interface{}, options ...*RequestOptions) *Promise
- func RequestAsync(method, urlStr string, options ...*RequestOptions) *Promise
- type Proxy
- type RequestInterceptors
- type RequestOptions
- type Response
- func Delete(urlStr string, options ...*RequestOptions) (*Response, error)
- func Get(urlStr string, options ...*RequestOptions) (*Response, error)
- func Head(urlStr string, options ...*RequestOptions) (*Response, error)
- func Options(urlStr string, options ...*RequestOptions) (*Response, error)
- func Patch(urlStr string, body interface{}, options ...*RequestOptions) (*Response, error)
- func Post(urlStr string, body interface{}, options ...*RequestOptions) (*Response, error)
- func Put(urlStr string, body interface{}, options ...*RequestOptions) (*Response, error)
- func Request(method, urlStr string, options ...*RequestOptions) (*Response, error)
- type ResponseInterceptors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetBaseURL ¶
func SetBaseURL(baseURL string)
Types ¶
type DefaultLogger ¶ added in v0.6.0
type DefaultLogger struct {
// contains filtered or unexported fields
}
func NewDefaultLogger ¶ added in v0.6.0
func NewDefaultLogger(options LogOptions) *DefaultLogger
func (*DefaultLogger) LogError ¶ added in v0.6.0
func (l *DefaultLogger) LogError(err error, level LogLevel)
func (*DefaultLogger) LogRequest ¶ added in v0.6.0
func (l *DefaultLogger) LogRequest(req *http.Request, level LogLevel)
func (*DefaultLogger) LogResponse ¶ added in v0.6.0
func (*DefaultLogger) SetLevel ¶ added in v0.6.0
func (l *DefaultLogger) SetLevel(level LogLevel)
type InterceptorOptions ¶ added in v0.3.0
type InterceptorOptions struct { RequestInterceptors RequestInterceptors ResponseInterceptors ResponseInterceptors }
type LogOptions ¶ added in v0.6.0
type Logger ¶ added in v0.6.0
type ProgressReader ¶ added in v0.5.0
type ProgressReader struct {
// contains filtered or unexported fields
}
type ProgressWriter ¶ added in v0.5.0
type ProgressWriter struct {
// contains filtered or unexported fields
}
type Promise ¶
type Promise struct {
// contains filtered or unexported fields
}
func DeleteAsync ¶
func DeleteAsync(urlStr string, options ...*RequestOptions) *Promise
func GetAsync ¶
func GetAsync(urlStr string, options ...*RequestOptions) *Promise
func HeadAsync ¶
func HeadAsync(urlStr string, options ...*RequestOptions) *Promise
func NewPromise ¶
func NewPromise() *Promise
func OptionsAsync ¶
func OptionsAsync(urlStr string, options ...*RequestOptions) *Promise
func PatchAsync ¶
func PatchAsync(urlStr string, body interface{}, options ...*RequestOptions) *Promise
func PostAsync ¶
func PostAsync(urlStr string, body interface{}, options ...*RequestOptions) *Promise
func PutAsync ¶
func PutAsync(urlStr string, body interface{}, options ...*RequestOptions) *Promise
func RequestAsync ¶
func RequestAsync(method, urlStr string, options ...*RequestOptions) *Promise
type RequestInterceptors ¶ added in v0.3.0
type RequestOptions ¶ added in v0.2.1
type RequestOptions struct { Method string URL string BaseURL string Params map[string]string Body interface{} Headers map[string]string Timeout int Auth *Auth ResponseType string ResponseEncoding string MaxRedirects int MaxContentLength int64 MaxBodyLength int64 Decompress bool ValidateStatus func(int) bool InterceptorOptions InterceptorOptions Proxy *Proxy OnUploadProgress func(bytesRead, totalBytes int64) OnDownloadProgress func(bytesRead, totalBytes int64) LogLevel LogLevel }
type Response ¶
func Patch ¶
func Patch(urlStr string, body interface{}, options ...*RequestOptions) (*Response, error)
type ResponseInterceptors ¶ added in v0.3.0
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
download
command
|
|
interceptor
command
|
|
promise_style
command
|
|
request_style
command
|
|
simple_style
command
|
Click to show internal directories.
Click to hide internal directories.