utils

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPDelete

func HTTPDelete(url string) ([]byte, error)

HTTPDelete calls a given URL with the HTTP DELETE method.

func HTTPGet

func HTTPGet(url string) ([]byte, error)

HTTPGet is a helper to make GET request call to url

func HTTPGetNTimes

func HTTPGetNTimes(url string, n int) ([]byte, error)

HTTPGetNTimes calls the url n times and returns the first success or last error.

func HTTPGetRaw

func HTTPGetRaw(url string) (*http.Response, error)

HTTPGetRaw is a helper to make GET request call to url

func HTTPGetRawNTimes

func HTTPGetRawNTimes(url string, n int) (*http.Response, error)

HTTPGetRawNTimes calls the url n times and returns the first success or last error.

func HTTPPost

func HTTPPost(url string, data []byte) ([]byte, error)

HTTPPost is a helper to make POST request call to url

func HTTPPostWithStatus added in v0.11.0

func HTTPPostWithStatus(url string, data []byte) ([]byte, int, error)

HTTPPostWithStatus is a helper to make POST request call to url

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

type StateTransactionKeyValue struct {
	Key           string
	Value         string
	OperationType string
}

StateTransactionKeyValue is a key-value pair with an operation type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL