controller

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Create = create{
	name_: web.NewFormArg[string]("name"),
}.Mount()
View Source
var Delete = delete_{
	path: "/api/delete/%s",
	id_:  web.NewPathArg[int]("id"),
}.Mount()
View Source
var HTMLEdit = html_edit{
	id_:     web.NewPathArg[int]("id"),
	limit:   QueryArgs.Limit,
	orderby: QueryArgs.OrderBy,
	page:    QueryArgs.Page,
}.Mount()
View Source
var HTMLList *html_list
View Source
var Index = Router.GET("/")
View Source
var List = list{
	orderby: QueryArgs.OrderBy,
	mytest:  web.NewHeaderArgOpt[string]("X-Mytest"),
	atest:   web.NewCookieArgOpt[string]("atest"),
}.Mount()
View Source
var Patch = patch{
	id_: web.NewPathArg[int]("id"),
}.Mount()
View Source
var QueryArgs = struct {
	Limit   web.QueryArg[int]
	OrderBy web.QueryArg[string]
	Page    web.QueryArg[int]
}{
	web.NewQueryArgOpt[int]("limit"),
	web.NewQueryArgOpt[string]("orderby"),
	web.NewQueryArgOpt[int]("page"),
}
View Source
var Router = web.New("Category", StartContext).SetVerbose()

Functions

This section is empty.

Types

type Context

type Context struct {
	*web.CoreContext
	Store     *model.Store
	MenuPath  string
	Content   html.HTMLer
	HasLayout bool
}

func StartContext

func StartContext(route web.Route, rw http.ResponseWriter, req *http.Request) *Context

func (*Context) WithLayout

func (c *Context) WithLayout(req *http.Request, inner html.HTMLer)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL