Documentation ¶
Index ¶
- Constants
- func HTTPDelete(url string) ([]byte, error)
- func HTTPGet(url string) ([]byte, error)
- func HTTPGetNTimes(url string, n int) ([]byte, error)
- func HTTPGetRaw(url string) (*http.Response, error)
- func HTTPGetRawNTimes(url string, n int) (*http.Response, error)
- func HTTPPost(url string, data []byte) ([]byte, error)
- func HTTPPostWithStatus(url string, data []byte) ([]byte, int, error)
- type SimpleKeyValue
- type StateTransactionKeyValue
Constants ¶
const DefaultProbeTimeout = 30 * time.Second
DefaultProbeTimeout is the a timeout used in HTTPGetNTimes() and HTTPGetRawNTimes() to avoid cases where early requests hang and block all subsequent requests.
Variables ¶
This section is empty.
Functions ¶
func HTTPDelete ¶
HTTPDelete calls a given URL with the HTTP DELETE method.
func HTTPGetNTimes ¶
HTTPGetNTimes calls the url n times and returns the first success or last error.
Since this is used to probe when servers are starting up, we want to use a smaller timeout value here to avoid early requests, if hanging, from blocking all subsequent ones.
func HTTPGetRaw ¶
HTTPGetRaw is a helper to make GET request call to url.
func HTTPGetRawNTimes ¶
HTTPGetRawNTimes calls the url n times and returns the first success or last error.
Since this is used to probe when servers are starting up, we want to use a smaller timeout value here to avoid early requests, if hanging, from blocking all subsequent ones.
Types ¶
type SimpleKeyValue ¶
type SimpleKeyValue struct { Key interface{} Value interface{} }
SimpleKeyValue can be used to simplify code, providing simple key-value pairs.
func GenerateRandomStringKeyValues ¶
func GenerateRandomStringKeyValues(num int) []SimpleKeyValue
GenerateRandomStringKeyValues generates random string key-values pairs.
func GenerateRandomStringKeys ¶
func GenerateRandomStringKeys(num int) []SimpleKeyValue
GenerateRandomStringKeys generates random string keys (values are nil).
func GenerateRandomStringValues ¶
func GenerateRandomStringValues(keyValues []SimpleKeyValue) []SimpleKeyValue
GenerateRandomStringValues sets random string values for the keys passed in.
type StateTransactionKeyValue ¶ added in v0.10.0
StateTransactionKeyValue is a key-value pair with an operation type.