Documentation
¶
Index ¶
- 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.Request
- func (ctx Ctx) Res() *response.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 Pagination
- type ResourceHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 Pagination ¶ added in v0.4.22
type Pagination[T any] struct { Page int `query:"page" json:"page"` PerPage int `query:"per_page" json:"per_page"` TotalRecord int `json:"total_record"` Filter map[string]any `query:"filter" json:"filter"` Fields []string `query:"fields" json:"fields"` Sort map[string]string `query:"sort" json:"sort"` Data []T `json:"data"` }
func PaginationFromPagination ¶ added in v0.4.22
func PaginationFromPagination[T, U any](input Pagination[U]) Pagination[T]
func PaginationFromReq ¶ added in v0.4.22
func PaginationFromReq[T any](r *http.Request) Pagination[T]
func (Pagination[T]) MarshalJSON ¶ added in v0.4.22
func (p Pagination[T]) MarshalJSON() ([]byte, error)
func (*Pagination[T]) SetData ¶ added in v0.4.22
func (p *Pagination[T]) SetData(data ...T)
func (Pagination[T]) Skip ¶ added in v0.4.22
func (p Pagination[T]) Skip() int
func (Pagination[T]) TotalPage ¶ added in v0.4.22
func (p Pagination[T]) TotalPage() float64
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.