Documentation
¶
Index ¶
- func GenerateURI(uri string, queryParams map[string]string) string
- func GetResponseHeaders(resp *fasthttp.Response) map[string]string
- func SetHeaders(req *fasthttp.Request, headers map[string]string)
- func SetHeadersInRequest(headers interface{}, req *fasthttp.Request) error
- func SetQueryParamsInURI(queryParams interface{}, uri string) (string, error)
- func SetRequestBody(body interface{}, req *fasthttp.Request) error
- type ClientInterface
- type ConcurrentResponse
- type FHClient
- type RateLimitedClient
- type Request
- type Response
- func Connect(client ClientInterface, uri string, queryParams any, headers any) (*Response, error)
- func Delete(client ClientInterface, uri string, queryParams any, headers any, body any) (*Response, error)
- func Get(client ClientInterface, uri string, queryParams any, headers any) (*Response, error)
- func Head(client ClientInterface, uri string, queryParams any, headers any) (*Response, error)
- func NewResponse(statusCode int, headers map[string]string, body []byte, curlCmd string, ...) *Response
- func Options(client ClientInterface, uri string, queryParams any, headers any) (*Response, error)
- func Patch(client ClientInterface, uri string, queryParams any, headers any, body any) (*Response, error)
- func Post(client ClientInterface, uri string, queryParams any, headers any, body any) (*Response, error)
- func Put(client ClientInterface, uri string, queryParams any, headers any, body any) (*Response, error)
- func Trace(client ClientInterface, uri string, queryParams any, headers any) (*Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetHeadersInRequest ¶
func SetQueryParamsInURI ¶
SetQueryParamsInURI sets query parameters in the URI returns uri string without any error
func SetRequestBody ¶
sets body if present and returns nil as error. Function will also return nil if body == nil
Types ¶
type ClientInterface ¶
type ConcurrentResponse ¶
type ConcurrentResponse struct { Response *Response `json:"response" yaml:"response"` Error error `json:"error" yaml:"error"` }
func MakeConcurrentRequests ¶
func MakeConcurrentRequests(requests []*Request, client ClientInterface) []*ConcurrentResponse
func NewConcurrentResponse ¶
func NewConcurrentResponse(response *Response, err error) *ConcurrentResponse
type FHClient ¶
func NewFHClient ¶
type RateLimitedClient ¶
type RateLimitedClient struct { Requests int PerSeconds int RateLimited *rate.Limiter FHClient *FHClient }
func NewRateLimitedClient ¶
func NewRateLimitedClient(requests int, perSeconds int, fasthttp *fasthttp.Client) *RateLimitedClient
type Request ¶
type Response ¶
type Response struct { StatusCode int `json:"status_code" yaml:"status_code"` Headers map[string]string `json:"headers" yaml:"headers"` Body []byte `json:"body" yaml:"body"` CurlCommand string `json:"curl_command" yaml:"curl_command"` TimeElapsed time.Duration `json:"time_elapsed" yaml:"time_elapsed"` }
func NewResponse ¶
Click to show internal directories.
Click to hide internal directories.