Documentation ¶
Index ¶
- Variables
- func NewGZipBodyReader(body io.ReadCloser) (io.ReadCloser, error)
- type Options
- type Requests
- func (r *Requests) Delete(ctx context.Context, url string, headers http.Header) (resp *http.Response, err error)
- func (r *Requests) Do(ctx context.Context, method string, url string, headers http.Header, ...) (resp *http.Response, err error)
- func (r *Requests) Get(ctx context.Context, url string, headers http.Header) (resp *http.Response, err error)
- func (r *Requests) Post(ctx context.Context, url string, headers http.Header, body []byte) (resp *http.Response, err error)
- func (r *Requests) Put(ctx context.Context, url string, headers http.Header, body []byte) (resp *http.Response, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{ Compressed: true, HandshakeTimeout: 30 * time.Second, ResponseHeaderTimeout: 60 * time.Second, RequestTimeout: 60 * time.Second, ConnsPerHost: 5, TLSVersion: tls.VersionTLS13, }
DefaultOptions is a struct object which has default client option
View Source
var SignRequest func(*http.Request) error
SignRequest sign a http request so that it can talk to API server this is global implementation, if you do not set SignRequest in Options client will use this function
Functions ¶
func NewGZipBodyReader ¶
func NewGZipBodyReader(body io.ReadCloser) (io.ReadCloser, error)
Types ¶
type Options ¶
type Options struct { TLSVersion int TLSConfig *tls.Config Compressed bool HandshakeTimeout time.Duration ResponseHeaderTimeout time.Duration RequestTimeout time.Duration ConnsPerHost int SignRequest func(*http.Request) error }
Options is a struct which provides options for client
Click to show internal directories.
Click to hide internal directories.