Documentation ¶
Index ¶
- Constants
- type Credential
- type RESTClient
- func (r *RESTClient) Delete() *Request
- func (r *RESTClient) Get() *Request
- func (r *RESTClient) Head() *Request
- func (r *RESTClient) Patch() *Request
- func (r *RESTClient) Post() *Request
- func (r *RESTClient) Put() *Request
- func (r *RESTClient) WithCredential(c Credential) *RESTClient
- func (r *RESTClient) WithRateLimiter(th throttle.RateLimiter) *RESTClient
- type Request
- func (r *Request) Body(body map[string]interface{}) *Request
- func (r *Request) Do() *Result
- func (r *Request) SubPathf(subPath string, args ...interface{}) *Request
- func (r *Request) WithBasePath(basePath string) *Request
- func (r *Request) WithEndpoints(endpoints []string) *Request
- func (r *Request) WithHeaders(header http.Header) *Request
- func (r *Request) WithParam(paramName, value string) *Request
- func (r *Request) WithParams(params map[string]string) *Request
- func (r *Request) WithParamsFromURL(u *url.URL) *Request
- func (r *Request) WithTimeout(d time.Duration) *Request
- func (r *Request) WrapURL() *url.URL
- type Result
Constants ¶
View Source
const ( // SchemeHTTP HTTP scheme prefix SchemeHTTP = "http://" // SchemeHTTPS HTTPS scheme prefix SchemeHTTPS = "https://" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential map[string]interface{}
Credential credential to be filled in post body
type RESTClient ¶
type RESTClient struct {
// contains filtered or unexported fields
}
RESTClient client with metrics, ratelimit and
func NewRESTClientWithTLS ¶
func NewRESTClientWithTLS(conf *tls.Config) *RESTClient
NewRESTClientWithTLS create rest client with tls
func (*RESTClient) WithCredential ¶
func (r *RESTClient) WithCredential(c Credential) *RESTClient
WithCredential set credential
func (*RESTClient) WithRateLimiter ¶
func (r *RESTClient) WithRateLimiter(th throttle.RateLimiter) *RESTClient
WithRateLimiter set rate limiter
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request for http request
func (*Request) WithBasePath ¶
WithBasePath set base path
func (*Request) WithEndpoints ¶
WithEndpoints set endpoints
func (*Request) WithHeaders ¶
WithHeaders with http headers
func (*Request) WithParams ¶
WithParams add params
func (*Request) WithParamsFromURL ¶
WithParamsFromURL set params from url
func (*Request) WithTimeout ¶
WithTimeout with http timeout
Click to show internal directories.
Click to hide internal directories.