utilities

package
v4.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddQueryToPath

func AddQueryToPath(path string, query interface{}) (string, error)

AddQueryToPath adds the model as a JSON-encoded query parameter to the path and returns the new path.

func BuildAPIPath

func BuildAPIPath(parts ...interface{}) (string, error)

func CheckHTTPResponse

func CheckHTTPResponse(resp *http.Response) (interface{}, error)

receive http response, check error code status, if good return json of resp.Body else return error

func CheckHTTPResponseWithCursor

func CheckHTTPResponseWithCursor(resp *http.Response) (interface{}, *string, error)

receive http response, check error code status, if good return json of resp.Body else return error

func IsPathValid

func IsPathValid(path string) bool

Check if the constructed path matches any of the allowed path patterns

func ValidateQueryParams

func ValidateQueryParams(query interface{}, validators map[string]func(interface{}) bool) bool

ValidateQueryParams validates the query parameters based on the provided validators.

Types

This section is empty.

Jump to

Keyboard shortcuts

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