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 Ctx
- func (ctx Ctx) Deadline() (time.Time, bool)
- func (ctx Ctx) Done() <-chan struct{}
- func (ctx Ctx) Err() error
- func (ctx Ctx) Req() *Request
- func (ctx Ctx) Res() *Response
- func (ctx *Ctx) SetContext(ctxNew context.Context)
- func (ctx *Ctx) SetValue(key, value any)
- func (ctx Ctx) Value(key any) any
- func (ctx *Ctx) Write(content []byte) (int, error)
- type CtxSse
- 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 (r *Response) ToHttp() http.ResponseWriter
- 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 Ctx ¶ added in v0.3.100
type Ctx struct {
// contains filtered or unexported fields
}
func (*Ctx) SetContext ¶ added in v0.3.100
type CtxSse ¶ added in v0.3.100
type CtxSse struct {
*Ctx
// contains filtered or unexported fields
}
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) ToHttp ¶ added in v0.3.100
func (r *Response) ToHttp() http.ResponseWriter
func (Response) Unauthorized ¶ added in v0.3.98
Click to show internal directories.
Click to hide internal directories.