Documentation
¶
Index ¶
- type RTClient
- type Request
- func (r *Request) Body(obj interface{}) *Request
- func (r *Request) Do(ctx context.Context) Result
- func (r *Request) MaxRetries(maxRetries int) *Request
- func (r *Request) Prefix(prefixPath ...string) *Request
- func (r *Request) RequestURL(uri string) *Request
- func (r *Request) SetHeader(key string, values ...string) *Request
- func (r *Request) SetParams(paramName, value string) *Request
- func (r *Request) SetPath(suffixPath ...string) *Request
- func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error)
- func (r *Request) Timeout(d time.Duration) *Request
- func (r *Request) URL() *url.URL
- func (r *Request) Verb(verb string) *Request
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RTClient ¶
func NewHttpClient ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) Body ¶
Body makes the request use obj as the body. Optional. If obj is a string, try to read a file of that name. If obj is a []byte, send it directly. If obj is an io.Reader, use it directly. If obj is a nil, return Request directly. Otherwise, set an error.
func (*Request) MaxRetries ¶
func (*Request) RequestURL ¶
RequestURL overwrites existing path and parameters with the value of the provided server relative for example: uri= http://www.example.com:8080/api overwrites info: r.path=/api;r.shceme=http;r.host=www.example.com:8080
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (Result) Into ¶
Into Unmarshal response data into struct obj, an error will be returned if the Result object has an error or a deserialization error
func (Result) StatusCode ¶
StatusCode return http response status code