Documentation
¶
Index ¶
- func HttpAccepted(rw http.ResponseWriter, body any)
- func HttpBadRequest(rw http.ResponseWriter, body any)
- func HttpConflict(rw http.ResponseWriter, body any)
- func HttpCreated(rw http.ResponseWriter, body any)
- func HttpForbidden(rw http.ResponseWriter)
- func HttpInternalServerError(rw http.ResponseWriter, body any)
- func HttpNoContent(rw http.ResponseWriter)
- func HttpNotFound(rw http.ResponseWriter)
- func HttpOk(rw http.ResponseWriter, body any)
- func HttpUnauthorized(rw http.ResponseWriter)
- type Config
- type ConfigureFunc
- type Hooks
- type Pagination
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpAccepted ¶
func HttpAccepted(rw http.ResponseWriter, body any)
func HttpBadRequest ¶
func HttpBadRequest(rw http.ResponseWriter, body any)
func HttpConflict ¶
func HttpConflict(rw http.ResponseWriter, body any)
func HttpCreated ¶
func HttpCreated(rw http.ResponseWriter, body any)
func HttpForbidden ¶
func HttpForbidden(rw http.ResponseWriter)
func HttpInternalServerError ¶
func HttpInternalServerError(rw http.ResponseWriter, body any)
func HttpNoContent ¶
func HttpNoContent(rw http.ResponseWriter)
func HttpNotFound ¶
func HttpNotFound(rw http.ResponseWriter)
func HttpOk ¶
func HttpOk(rw http.ResponseWriter, body any)
func HttpUnauthorized ¶
func HttpUnauthorized(rw http.ResponseWriter)
Types ¶
type Config ¶
type Config struct {
App config.App
Security config.Security `json:"security,omitempty"`
SQLs map[string]config.SQL `json:"sql,omitempty"`
Http map[string]config.Http `json:"http,omitempty"`
Smtp map[string]config.Smtp `json:"smtp,omitempty"`
Others map[string]string `json:"others,omitempty"`
EnvFile string `json:"env_file,omitempty"`
IsTesting bool `json:"is_testing,omitempty"`
}
type ConfigureFunc ¶
type ConfigureFunc func(*Project)
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (*Hooks) OnStarting ¶ added in v0.3.72
func (h *Hooks) OnStarting(hook func())
type Pagination ¶
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 PaginationFromReq ¶
func PaginationFromReq[T any](r *http.Request) Pagination[T]
func (Pagination[T]) MarshalJSON ¶
func (p Pagination[T]) MarshalJSON() ([]byte, error)
func (*Pagination[T]) SetData ¶
func (p *Pagination[T]) SetData(data ...T)
func (Pagination[T]) Skip ¶
func (p Pagination[T]) Skip() int
func (Pagination[T]) TotalPage ¶
func (p Pagination[T]) TotalPage() float64
Source Files
¶
Click to show internal directories.
Click to hide internal directories.