views

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateApi

func CreateApi[C, V any](ctx *gin.Context, fn func(context.Context, C) (V, error))

func DeleteByIdApi

func DeleteByIdApi(ctx *gin.Context, fn func(context.Context, uint, ...uint) error)

func Error

func Error(ctx *gin.Context, code int, err error)

func OneByIdApi

func OneByIdApi[T any](ctx *gin.Context, fn func(context.Context, uint) (*T, error))

func PaginateApi

func PaginateApi[Q, D any](ctx *gin.Context, fn func(context.Context, *Q) (*repo.Paginator[D], error))

func Response

func Response(ctx *gin.Context, code int, message string, data any)

func ReturnWithCode

func ReturnWithCode(ctx *gin.Context, code int, data any)

func Success

func Success(ctx *gin.Context, data any)

func UpdateByIdApi

func UpdateByIdApi[T any](ctx *gin.Context, fn func(context.Context, uint, *T) error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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