Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupCorsOriginHeader ¶
func SetupCorsOriginHeader(w *http.ResponseWriter, req *http.Request)
SetupCorsOriginHeader sets the CORS headers for the response.
- Use this function for all the public APIs.
func WriteJsonResp ¶
func WriteJsonResp(w http.ResponseWriter, err error, respBody interface{}, status int)
WriteJsonResp writes the response in JSON format.
- Use this function for writing the response for all the APIs.
Types ¶
type ApiError ¶
type ApiError struct {
HttpStatusCode int `json:"-"`
Code string `json:"code,omitempty"`
InternalMessage string `json:"internalMessage,omitempty"`
UserMessage interface{} `json:"userMessage,omitempty"`
UserDetailMessage string `json:"userDetailMessage,omitempty"`
}
ApiError represents an error response
func NewApiError ¶
NewApiError creates a new ApiError object
Click to show internal directories.
Click to hide internal directories.