genericcontrollers_gorm_gin

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BadRequest = http.StatusBadRequest
View Source
const Created = http.StatusCreated
View Source
const InternalServerError = http.StatusInternalServerError
View Source
const NotFound = http.StatusNotFound
View Source
const UnAuthorized = http.StatusUnauthorized

Variables

View Source
var Validate = validator.New()

Functions

func Create

func Create[T any](model *T, c *gin.Context, fnServiceCreate func(t T) (T, responses.GenericResponse, error))

func CreateBatch

func CreateBatch[T any](model []T, c *gin.Context, fnServiceCreate func(t []T) ([]T, responses.GenericResponse, error))

func DeletePermanentlyById

func DeletePermanentlyById[T any](c *gin.Context, fnServiceDeletePermanentlyById func(id string) (int64, error))

func DeleteSoftlyById

func DeleteSoftlyById[T any](c *gin.Context, fnServiceDeleteSoftlyById func(id string) (int64, error))

func GetAll

func GetAll[T any](c *gin.Context, fnServiceGetAll func() ([]T, error))

func GetAllByClientId

func GetAllByClientId[T any](c *gin.Context, fnServiceGetAll func(id string) ([]T, error))

func GetAllByOtherPathParamsId

func GetAllByOtherPathParamsId[T any](c *gin.Context, fnServiceGetAll func(pathParams ...genericcrud_repositories_gorm.PathParams) ([]T, error), pathParams ...string)

func GetOneById

func GetOneById[T any](c *gin.Context, fnServiceGetOneById func(id string) (T, error))

func PatchById

func PatchById[T any](model *models.PatchByIdModel, c *gin.Context, fnServicePatch func(object models.PatchByIdModel) (T, error))

func UpdateById

func UpdateById[T any](model *T, c *gin.Context, fnServiceUpdate func(t T, id string) (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