Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPCaller ¶
NewHTTPCaller HTTPCaller's constructor
func NewHTTPConnection ¶
func NewHTTPConnection(url string) *httpConnection
NewHTTPConnection Default configuration for http connection
func Retry ¶
func Retry(f func(httpConnection) HTTPResponse, args httpConnection, log *logrus.Entry) *retryHTTP
Retry It will retry all failure calls for the given certain of times
Types ¶
type ActualResponse ¶
ActualResponse To handle if user given urls
type HTTPInterface ¶
type HTTPInterface interface { // To handle http get calls Get(httpConnection) HTTPResponse // To handle http post calls Post(httpConnection) HTTPResponse // To handle http put calls Put(httpConnection) HTTPResponse // To handle http delete calls Delete(httpConnection) HTTPResponse }
HTTPInterface It handles all kind of rest calls
type HTTPResponse ¶
type HTTPResponse struct { Response string ActualResponse ActualResponse // contains filtered or unexported fields }
HTTPResponse Response from http calls
func (*HTTPResponse) ActualRespToStr ¶
func (httpResponse *HTTPResponse) ActualRespToStr() string
func (*HTTPResponse) CodeConverter ¶
func (httpResponse *HTTPResponse) CodeConverter() int
CodeConverter Convert actual code into appropriate user request
func (*HTTPResponse) GetError ¶
func (httpResponse *HTTPResponse) GetError() string
GetError It will Parse error from http response It returns parsed error message if response contains either reason or message otherwise it returns entire message
func (*HTTPResponse) IsSucceeded ¶
func (httpResponse *HTTPResponse) IsSucceeded() bool
IsSucceeded Check that made the call is scceeded or not
func (*HTTPResponse) JSON ¶
func (httpResponse *HTTPResponse) JSON() *json.JSON
Click to show internal directories.
Click to hide internal directories.