crud

package
v0.0.0-...-52ba2b6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidInput = errors.New("Invalid Input")

Functions

This section is empty.

Types

type CRUD

type CRUD[T db.Patchable] struct{}

T is the full GET model T2 is for the CREATE fields T3 is for the UPDATE fields

func New

func New[T db.Patchable]() *CRUD[T]

func (*CRUD[T]) Create

func (crud *CRUD[T]) Create(c *gin.Context)

Create creates a new datastore model, and then immediately GETs the model ensuring the most recent data is returned.

func (*CRUD[T]) CreateHTML

func (crud *CRUD[T]) CreateHTML(c *gin.Context)

func (*CRUD[T]) Delete

func (crud *CRUD[T]) Delete(c *gin.Context)

func (*CRUD[T]) Get

func (crud *CRUD[T]) Get(c *gin.Context)

func (*CRUD[T]) GetAll

func (crud *CRUD[T]) GetAll(c *gin.Context)

func (*CRUD[T]) GetAllHTML

func (crud *CRUD[T]) GetAllHTML(c *gin.Context)

func (*CRUD[T]) GetMulti

func (crud *CRUD[T]) GetMulti(c *gin.Context)

func (*CRUD[T]) GetOneHTML

func (crud *CRUD[T]) GetOneHTML(c *gin.Context)

func (*CRUD[T]) Update

func (crud *CRUD[T]) Update(c *gin.Context)

Jump to

Keyboard shortcuts

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