Documentation ¶
Index ¶
- func Respond(w http.ResponseWriter, statusCode int)
- func RespondWithBody(w http.ResponseWriter, statusCode int, responseBody interface{})
- func RespondWithError(w http.ResponseWriter, apperr apperrors.AppError)
- func RespondWithErrorAndLog(w http.ResponseWriter, apperr apperrors.AppError)
- func WithMiddlewares(router *mux.Router, middlewares ...mux.MiddlewareFunc)
- type WriterWithStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Respond ¶
func Respond(w http.ResponseWriter, statusCode int)
func RespondWithBody ¶
func RespondWithBody(w http.ResponseWriter, statusCode int, responseBody interface{})
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, apperr apperrors.AppError)
func RespondWithErrorAndLog ¶
func RespondWithErrorAndLog(w http.ResponseWriter, apperr apperrors.AppError)
func WithMiddlewares ¶
func WithMiddlewares(router *mux.Router, middlewares ...mux.MiddlewareFunc)
WithMiddlewares decorates router with middlewares
Types ¶
type WriterWithStatus ¶
type WriterWithStatus struct { http.ResponseWriter // contains filtered or unexported fields }
func (*WriterWithStatus) IsSuccessful ¶
func (w *WriterWithStatus) IsSuccessful() bool
func (*WriterWithStatus) WriteHeader ¶
func (w *WriterWithStatus) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.