Documentation
¶
Index ¶
- func ReadBody[T any](req *http.Request, data *T) error
- type Response
- func (r *Response) BadRequestWithMessage(message string)
- func (r *Response) BadRequestWithMessages(responseMessage, logMessage string)
- func (r *Response) ConflictWithMessage(message string)
- func (r *Response) ConflictWithMessages(responseMessage, logMessage string)
- func (r *Response) CreatedWithMessage(message string)
- func (r *Response) Data(status int, data any)
- func (r *Response) ErrorWithMessages(code int, responseMessage string, logMessage string, err error)
- func (r *Response) InternalServerErrorWithMessage(err error, message string)
- func (r *Response) InternalServerErrorWithMessages(err error, responseMessage string, logMessage string)
- func (r *Response) InvalidInputWithMessage(err error, message string)
- func (r *Response) InvalidInputWithMessages(err error, responseMessage, logMessage string)
- func (r *Response) NoContent()
- func (r *Response) NotAcceptableWithMessage(message string)
- func (r *Response) NotAcceptableWithMessages(responseMessage, logMessage string)
- func (r *Response) NotFoundWithMessage(message string)
- func (r *Response) NotFoundWithMessages(responseMessage, logMessage string)
- func (r *Response) OK(data any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Response ¶
type Response struct {
Writer http.ResponseWriter
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse(w http.ResponseWriter) *Response
func NewResponseWithLogger ¶
func (*Response) BadRequestWithMessage ¶
func (*Response) BadRequestWithMessages ¶
func (*Response) ConflictWithMessage ¶
func (*Response) ConflictWithMessages ¶
func (*Response) CreatedWithMessage ¶
TODO: Need to modify this to include the uri for created resource
func (*Response) ErrorWithMessages ¶
func (*Response) InternalServerErrorWithMessage ¶
func (*Response) InternalServerErrorWithMessages ¶
func (*Response) InvalidInputWithMessage ¶
func (*Response) InvalidInputWithMessages ¶
func (*Response) NotAcceptableWithMessage ¶
func (*Response) NotAcceptableWithMessages ¶
func (*Response) NotFoundWithMessage ¶
func (*Response) NotFoundWithMessages ¶
Click to show internal directories.
Click to hide internal directories.