Documentation
¶
Index ¶
- Variables
- func SetEnvironment(env string)
- type Response
- func Error(httpCode int, errorCode int, errorName string, message string) *Response
- func ErrorDetail(httpCode int, errorCode int, errorName string, message string, detail error) *Response
- func SuccessData(data any) *Response
- func SuccessDataMessage(data any, msg string) *Response
- func SuccessMessage(msg string) *Response
Constants ¶
This section is empty.
Variables ¶
View Source
var Environment = "development"
Functions ¶
func SetEnvironment ¶
func SetEnvironment(env string)
Types ¶
type Response ¶
type Response struct {
HttpCode int `json:"httpCode,omitempty"`
ErrorCode int `json:"errorCode,omitempty"`
ErrorName string `json:"errorName,omitempty"`
Message string `json:"message,omitempty"`
Data any `json:"data,omitempty"`
StackTrace []string `json:"stack,omitempty"`
Details *string `json:"details,omitempty"`
}
Response represents a standard API response
func ErrorDetail ¶
func SuccessDataMessage ¶
SuccessData creates a success response
func SuccessMessage ¶
Click to show internal directories.
Click to hide internal directories.