Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = &ErrorResponse{ BaseResponse: BuildBaseResponse(StatusError), Message: "Invalid request format", } ErrConflict = &ErrorResponse{ BaseResponse: BuildBaseResponse(StatusError), Message: "Entity already exists", } ErrForbidden = &ErrorResponse{ BaseResponse: BuildBaseResponse(StatusError), Message: "Forbidden", } ErrInternalServer = &ErrorResponse{ BaseResponse: BuildBaseResponse(StatusError), Message: "Unable to process request", } ErrInvalidAPIKey = &ErrorResponse{ BaseResponse: BuildBaseResponse(StatusError), Message: "API key is invaild or expired", } ErrNotFound = &ErrorResponse{ BaseResponse: BuildBaseResponse(StatusError), Message: "Resource not found", } BaseResponse: BuildBaseResponse(StatusError), Message: "Tenant not authorized for this service", } ErrUnsupportedContentType = &ErrorResponse{ BaseResponse: BuildBaseResponse(StatusError), Message: "Unsupported Content-Type", } )
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type BaseResponse struct { RequestID string `json:"requestId" example:"api_1234567890abcdef"` // Status indicates the result of the operation ("success" or "error") Status string `json:"status" example:"success"` }
func BuildBaseResponse ¶
func BuildBaseResponse(status Status) BaseResponse
type ErrorResponse ¶
type ErrorResponse struct { BaseResponse Message string `json:"message,omitempty"` }
func (*ErrorResponse) WithMessage ¶
func (e *ErrorResponse) WithMessage(message string) *ErrorResponse
Click to show internal directories.
Click to hide internal directories.