package
0.0.0-20230806205039-9e5d004951a3
Repository: https://github.com/m5lapp/go-service-toolkit.git
Documentation: pkg.go.dev

# Functions

DecodeJSON unmarshals the contents of j into dst, checking for and returning any errors along the way.
NewJSendError returns a JSendResponse that indicates that the request failed due to an error on the server.
NewJSendFail returns a JSendResponse that indicates that the request was "rejected due to invalid data or call conditions".
NewJSendSuccess returns a JSendResponse that indicates that everything went well with the request and usually some data is also returned.
ReadJSON reads the JSON payload from a http.Request and decodes it into the given dst parameter, checking for any errors along the way.
RequestJSend sends an HTTP request of the given method type to the given URL with the given JSON requestBody and timeout and attempts to decode the response payload into a JSendResponseRaw struct.
WriteJSendError checks the provided HTTP status code is a valid server-side error code, then calls WriteJSON with an appropriate JSend payload.
WriteJSendFail checks the provided HTTP status code is a valid client-side error code, then calls WriteJSON with an appropriate JSend payload.
WriteJSendSuccess checks the provided HTTP status code is a valid success code, then calls WriteJSON with an appropriate JSend payload.
WriteJSON marshals the contents of data into a JSON payload and writes it to the given http.ResponseWriter with the given HTTP status code and headers.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
JSend Statuses should only be one of the JSendStatus* consts.

# Structs

DateOnly embedds a time.Time struct to represent a date without a time component.
JSendResponse represents a JSend JSON response payload.
JSendResponseRaw also represents a JSend JSON response payload like JSendResponse, except the Data field is a json.RawMessage.

# Type aliases

Evelope represents the payload of a JSON response mapping string keys to any types of value.