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 Request
- type ResourceHandler
- type Response
- func (ctx Response) Accepted(body ...any) error
- func (ctx Response) BadRequest(body ...any) error
- func (ctx Response) Conflict(body ...any) error
- func (ctx Response) Created(body ...any) error
- func (ctx Response) Forbidden(body ...any) error
- func (ctx Response) InternalServerError(body ...any) error
- func (ctx Response) NoContent() error
- func (ctx Response) NotFound(body ...any) error
- func (ctx Response) Ok(body ...any) error
- func (ctx Response) Unauthorized(body ...any) error
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 Request ¶ added in v0.3.98
func NewRequest ¶ added in v0.3.98
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)
}
type Response ¶ added in v0.3.98
func NewResponse ¶ added in v0.3.97
func NewResponse(w http.ResponseWriter) *Response
func (Response) BadRequest ¶ added in v0.3.98
func (Response) InternalServerError ¶ added in v0.3.98
func (Response) Unauthorized ¶ added in v0.3.98
Click to show internal directories.
Click to hide internal directories.