Documentation
¶
Index ¶
- func Error(w http.ResponseWriter, r *http.Request, e AppError)
- func HandleError(w http.ResponseWriter, r *http.Request, e string, code int)
- func Handlers() map[string]http.Handler
- func NewRouter(handlers map[string]http.Handler, apis ...string) (*openapimux.OpenAPIMux, error)
- func Success(w http.ResponseWriter, data interface{}, code int)
- type AppError
- type HealthCheckHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, r *http.Request, e AppError)
Error returns error response.
func HandleError ¶
HandleError returns default error handler.
func NewRouter ¶
func NewRouter(handlers map[string]http.Handler, apis ...string) (*openapimux.OpenAPIMux, error)
NewRouter returns a router.
func Success ¶
func Success(w http.ResponseWriter, data interface{}, code int)
Success returns successful response.
Types ¶
type HealthCheckHandler ¶
type HealthCheckHandler struct{}
HealthCheckHandler standard handler for healthCheck endpoint - outputs OK.
func (HealthCheckHandler) ServeHTTP ¶
func (h HealthCheckHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.