Documentation
¶
Index ¶
- Constants
- Variables
- func Create(opts Options) http.HandlerFunc
- func Decode(r *http.Request, target any) error
- func DecodeLimit(r *http.Request, target any, maxBytes int64) error
- func Delete(opts Options) http.HandlerFunc
- func Detail(opts Options) http.HandlerFunc
- func Error(r *http.Request, message string)
- func Flash(r *http.Request, kind, message string)
- func Info(r *http.Request, message string)
- func JSON(w http.ResponseWriter, status int, payload any) error
- func JSONError(w http.ResponseWriter, status int, message string) error
- func JSONProblems(w http.ResponseWriter, status int, problems map[string][]string) error
- func List(opts Options) http.HandlerFunc
- func Redirect(w http.ResponseWriter, r *http.Request, target string)
- func RedirectPermanent(w http.ResponseWriter, r *http.Request, target string)
- func SafeNext(next, fallback string) string
- func Success(r *http.Request, message string)
- func Update(opts Options) http.HandlerFunc
- func WantsJSON(r *http.Request) bool
- func Warning(r *http.Request, message string)
- type Data
- type Options
- type Page
- type Pages
- type Paginator
- type Renderer
Constants ¶
View Source
const DefaultMaxJSONBody = 1 << 20
View Source
const (
DefaultPerPage = 10
)
Variables ¶
View Source
var ErrBodyTooLarge = errors.New("coyote/view: request body is too large")
Functions ¶
func Create ¶
func Create(opts Options) http.HandlerFunc
func Delete ¶
func Delete(opts Options) http.HandlerFunc
func Detail ¶
func Detail(opts Options) http.HandlerFunc
func JSONProblems ¶
func List ¶
func List(opts Options) http.HandlerFunc
func RedirectPermanent ¶
func RedirectPermanent(w http.ResponseWriter, r *http.Request, target string)
func Update ¶
func Update(opts Options) http.HandlerFunc
Types ¶
type Options ¶
type Options struct {
Store model.Store
Schema *model.Schema
Template string
Renderer Renderer
PerPage int
Paginator Paginator
Order string
Fields []string
Exclude []string
Filter func(*http.Request, model.Query) model.Query
Allow func(*http.Request) bool
Data func(*http.Request, Data) Data
Redirect string
IDParam string
}
type Page ¶
Click to show internal directories.
Click to hide internal directories.