Documentation
¶
Index ¶
- func Configure(c *config.Web)
- func Resource(path string, resource ResourceHandler, opts ...func(*ngamux.HttpServeMux))
- func Router() *ngamux.HttpServeMux
- func Server() *http.Server
- func WithResourceMiddleware(middlewares ...ngamux.MiddlewareFunc) func(*ngamux.HttpServeMux)
- type HttpResponse
- func (ctx HttpResponse) Accepted(body ...any) error
- func (ctx HttpResponse) BadRequest(body ...any) error
- func (ctx HttpResponse) Conflict(body ...any) error
- func (ctx HttpResponse) Created(body ...any) error
- func (ctx HttpResponse) Forbidden(body ...any) error
- func (ctx HttpResponse) InternalServerError(body ...any) error
- func (ctx HttpResponse) NoContent() error
- func (ctx HttpResponse) NotFound(body ...any) error
- func (ctx HttpResponse) Ok(body ...any) error
- func (ctx HttpResponse) Unauthorized(body ...any) error
- type ResourceHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resource ¶
func Resource(path string, resource ResourceHandler, opts ...func(*ngamux.HttpServeMux))
func Router ¶
func Router() *ngamux.HttpServeMux
func WithResourceMiddleware ¶
func WithResourceMiddleware(middlewares ...ngamux.MiddlewareFunc) func(*ngamux.HttpServeMux)
Types ¶
type HttpResponse ¶ added in v0.3.97
func NewResponse ¶ added in v0.3.97
func NewResponse(w http.ResponseWriter) *HttpResponse
func (HttpResponse) Accepted ¶ added in v0.3.97
func (ctx HttpResponse) Accepted(body ...any) error
func (HttpResponse) BadRequest ¶ added in v0.3.97
func (ctx HttpResponse) BadRequest(body ...any) error
func (HttpResponse) Conflict ¶ added in v0.3.97
func (ctx HttpResponse) Conflict(body ...any) error
func (HttpResponse) Created ¶ added in v0.3.97
func (ctx HttpResponse) Created(body ...any) error
func (HttpResponse) Forbidden ¶ added in v0.3.97
func (ctx HttpResponse) Forbidden(body ...any) error
func (HttpResponse) InternalServerError ¶ added in v0.3.97
func (ctx HttpResponse) InternalServerError(body ...any) error
func (HttpResponse) NoContent ¶ added in v0.3.97
func (ctx HttpResponse) NoContent() error
func (HttpResponse) NotFound ¶ added in v0.3.97
func (ctx HttpResponse) NotFound(body ...any) error
func (HttpResponse) Ok ¶ added in v0.3.97
func (ctx HttpResponse) Ok(body ...any) error
func (HttpResponse) Unauthorized ¶ added in v0.3.97
func (ctx HttpResponse) Unauthorized(body ...any) error
type ResourceHandler ¶
type ResourceHandler interface {
Index(http.ResponseWriter, *http.Request)
Show(http.ResponseWriter, *http.Request)
Store(http.ResponseWriter, *http.Request)
Update(http.ResponseWriter, *http.Request)
Destroy(http.ResponseWriter, *http.Request)
}
Click to show internal directories.
Click to hide internal directories.