controller

package
v0.2.3-alpha-7 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCreate

func HandleCreate[M any, U any](cx *gin.Context, r repoCreate[M, U], accessChecker ...AccessChecker[M])

func HandleDelete

func HandleDelete[M any](cx *gin.Context, r repoDelete[M], accessChecker ...AccessChecker[M])

func HandleList

func HandleList[M any](cx *gin.Context, r repo.Filterer[M], baseUrl *url.URL, q query.Builder)

func HandleUpdate

func HandleUpdate[M any, U any](cx *gin.Context, r repoUpdate[M, U], accessChecker ...AccessChecker[M])

func HandleView

func HandleView[M any](cx *gin.Context, r repo.Identifier[M], accessChecker ...AccessChecker[M])

Types

type AccessChecker

type AccessChecker[M any] func(m M) error

type CRUD

type CRUD interface {
	Creator
	Lister
	Viewer
	Updater
	Deleter
}

type Creator

type Creator interface {
	Create(cx *gin.Context)
}

type Deleter

type Deleter interface {
	Delete(cx *gin.Context)
}

type Lister

type Lister interface {
	List(cx *gin.Context)
}

type Updater

type Updater interface {
	Update(cx *gin.Context)
}

type Viewer

type Viewer interface {
	View(cx *gin.Context)
}

Jump to

Keyboard shortcuts

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