dao

package
v0.0.0-...-2637cd7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MessageResponse

func MessageResponse(ctx *gin.Context, status int, message string, a ...any)

func Paginate

func Paginate(ctx *gin.Context) (int, int, string, error)

Types

type DAO

type DAO[T, TShort any] struct {
	Preload func(tx *gorm.DB) *gorm.DB
	Filter  func(ctx *gin.Context) (map[string]any, error)
}

func (DAO[T, TShort]) Create

func (dao DAO[T, TShort]) Create(ctx *gin.Context)

func (DAO[T, TShort]) Delete

func (dao DAO[T, TShort]) Delete(ctx *gin.Context)

func (DAO[T, TShort]) GetMany

func (dao DAO[T, TShort]) GetMany(ctx *gin.Context)

func (DAO[T, TShort]) GetOne

func (dao DAO[T, TShort]) GetOne(ctx *gin.Context)

func (DAO[T, TShort]) Update

func (dao DAO[T, TShort]) Update(ctx *gin.Context)

type IDAO

type IDAO interface {
	GetOne(ctx *gin.Context)
	GetMany(ctx *gin.Context)
	Create(ctx *gin.Context)
	Update(ctx *gin.Context)
	Delete(ctx *gin.Context)
}

type Message

type Message struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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