category

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Create = struct {
	Routes crudl.Create[*model]

	FormName wc.FormArg
}{
	crudl.Create[*model]{
		GET:  Router.GET(createCategoryNS),
		POST: Router.POST(createCategoryNS + "-post/"),
		ID:   html.ID(createCategoryNS),
	},

	wc.NewFormArg("name").String(),
}
View Source
var Delete = struct {
	Routes crudl.Delete[*model]

	Path1ID wc.PathArg
}{
	crudl.Delete[*model]{
		DELETE: Router.GET(deleteCategoryNS + "/%s"),
		ID:     html.ID(deleteCategoryNS),
	},

	wc.NewPathArg("id"),
}
View Source
var List = struct {
	Routes crudl.List[*model]
}{
	crudl.List[*model]{
		GET: Router.GET(listCategoriesNS + "/"),
		ID:  html.ID(listCategoriesNS),
	},
}
View Source
var Router = wc.New("Category", startModel, stopModel)
View Source
var Update = struct {
	Routes crudl.Update[*model]

	Path1ID  wc.PathArg
	FormName wc.FormArg
}{
	crudl.Update[*model]{
		GET: Router.GET(updateCategoryNS + "/%s"),
		PUT: Router.POST(updateCategoryNS + "-put/%s"),
		ID:  html.ID(updateCategoryNS),
	},

	wc.NewPathArg("id"),
	wc.NewFormArg("name").String(),
}

Functions

This section is empty.

Types

type Category

type Category struct {
	ID   int
	Name string
}

type Store

type Store struct {
	Categories []*Category
	sync.RWMutex
}

Jump to

Keyboard shortcuts

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