Documentation
¶
Index ¶
- Variables
- func GetAddress(v interface{}) string
- func IsNil(object interface{}) bool
- func ObjectsAreEqual(expected, actual interface{}) bool
- func PrintlnJson(v interface{})
- type Assert
- func (a *Assert) Equal(expected, actual interface{}, msg string)
- func (a *Assert) Nil(obj interface{}, msg string)
- func (a *Assert) NoError(err error, msg string)
- func (a *Assert) NotEqual(expected, actual interface{}, msg string)
- func (a *Assert) NotNil(obj interface{}, msg string)
- func (a *Assert) True(cond bool, msg string)
- type HTTPClient
- type HTTPFormPoster
- type HTTPJsonPoster
- type HTTPRequester
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = utils.StdClient()
DefaultClient is a web-utils.SafeClient instance for the whole project's usage.
Functions ¶
func GetAddress ¶
func GetAddress(v interface{}) string
func ObjectsAreEqual ¶
func ObjectsAreEqual(expected, actual interface{}) bool
Types ¶
type HTTPClient ¶
type HTTPClient interface { HTTPRequester HTTPJsonPoster HTTPFormPoster }
HTTPClient wraps HTTP* interfaces.
type HTTPFormPoster ¶
type HTTPFormPoster interface {
PostFormWithRetry(url string, v url.Values, maxTries int, f utils.RequestHook) (tries, status int, body []byte, err error)
}
HTTPFormPoster is one of the "reversed" interface of web-utils.SafeClient for better unit tests; use it for POST requests (default to plain/text).
type HTTPJsonPoster ¶
type HTTPJsonPoster interface {
PostJsonWithRetry(url string, v interface{}, maxTries int, f utils.RequestHook) (tries, status int, body []byte, err error)
}
HTTPJsonPoster is one of the "reversed" interface of web-utils.SafeClient for better unit tests; use it for POST requests with JSON payload.
Click to show internal directories.
Click to hide internal directories.