Documentation ¶
Index ¶
- Constants
- func Delete(url string, payload interface{}, headers Header) (int, []byte, *errors.Error)
- func Flatten(data interface{}) (map[string]interface{}, *errors.Error)
- func Get(url string, headers Header) (int, []byte, *errors.Error)
- func GetExecPath() (string, *errors.Error)
- func IsPtr(ptr interface{}) *errors.Error
- func IsSlicePtr(ptr interface{}) *errors.Error
- func Post(url string, payload interface{}, headers Header) (int, []byte, *errors.Error)
- func Put(url string, payload interface{}, headers Header) (int, []byte, *errors.Error)
- func ReadConfig(cpath string, ptr interface{}) *errors.Error
- func Request(method, url string, payload interface{}, headers Header) (int, []byte, *errors.Error)
- func SliceEqual(a, b interface{}) bool
- func StartGinTestServer(routers []func(*gin.Engine)) (*httptest.Server, func(p string) string)
- func TestPostJSON(url string, body interface{}, expectedStatus int, ...) *errors.Error
- func ToMap(v interface{}, ptr interface{}) *errors.Error
- func ToMapInterface(v interface{}) (map[string]interface{}, *errors.Error)
- func ToMapString(v interface{}) (map[string]string, *errors.Error)
- type Header
- type ToMapOptions
Constants ¶
View Source
const ( ErrIsNotPtr = "err_is_not_ptr" ErrIsNestedPtr = "err_is_nested_ptr" ErrIsNotSlice = "err_is_not_slice" ErrIsNotMappable = "err_is_not_mappable" ErrCannotMarshal = "err_cannot_marshal" ErrCannotUnmarshal = "err_cannot_unmarshal" ErrCannotReadFilePath = "err_cannot_read_path_file" ErrCannotOpenConfigFile = "err_cannot_open_config_file" ErrCannotParseConfigFile = "err_cannot_parse_config_file" ErrCannotCreateRequest = "err_cannot_create_post_request" ErrRequestFailed = "err_request_failed" ErrCannotParseRequestBody = "err_cannot_parse_request_body" ErrUnexpectedResponseStatus = "err_unexpected_response_status" ErrUnexpectedResponse = "err_unexpected_response" )
Variables ¶
This section is empty.
Functions ¶
func Flatten ¶ added in v0.1.3
Flattens a map-like object.
May return:
- ErrIsNotPtr
- ErrIsNestedPtr
- ErrIsNotMappable
- ErrCannotMarshal
- ErrCannotUnmarshal
func IsSlicePtr ¶ added in v0.1.1
Check if slice is a slice of pointers.
May return:
- ErrIsNotSlice
- ErrIsNotPtr
- ErrIsNestedPtr
func ReadConfig ¶ added in v0.1.5
Reads a config file and assign it to a pointer.
May return:
- ErrCannotOpenConfigFile
- ErrCannotParseConfigFile
func SliceEqual ¶ added in v0.1.3
func SliceEqual(a, b interface{}) bool
Check if 2 slice value are equal. Return false if any value is not of type Slice.
func StartGinTestServer ¶ added in v0.1.6
func TestPostJSON ¶ added in v0.1.6
func ToMap ¶ added in v0.1.2
Convert v to the underlying value of ptr.
May return:
- ErrIsNotPtr
- ErrIsNestedPtr
- ErrIsNotMappable
- ErrCannotMarshal
- ErrCannotUnmarshal
func ToMapInterface ¶ added in v0.1.2
Convert v to a map[string]interface{}.
May return:
- ErrIsNotPtr
- ErrIsNestedPtr
- ErrIsNotMappable
- ErrCannotMarshal
- ErrCannotUnmarshal
Types ¶
type ToMapOptions ¶ added in v0.1.3
Click to show internal directories.
Click to hide internal directories.