handler

package
v0.0.0-...-4b66723 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrapper

func Wrapper[TRequest any, TEntity any, TModel any](ctx *Context[TRequest, TEntity, TModel], callback Callback[TRequest, TEntity, TModel]) error

Types

type Callback

type Callback[TRequest any, TEntity any, TModel any] func(ctx *Context[TRequest, TEntity, TModel]) (any, int64, error)

type Context

type Context[TRequest any, TEntity any, TModel any] struct {
	Ctx      context.Context
	FiberCtx *fiber.Ctx
	Request  TRequest
	Mapper   mapper.CruderMapper[TEntity, TModel]
	Data     ContextData
}

func NewContext

func NewContext[TRequest any, TEntity any, TModel any](fiberCtx *fiber.Ctx, mapper mapper.CruderMapper[TEntity, TModel]) *Context[TRequest, TEntity, TModel]

type ContextData

type ContextData struct {
	// contains filtered or unexported fields
}

type Crud

type Crud[TEntity any, TModel any] struct {
	UseCase appusecase.CruderUseCase[TEntity]
	Mapper  mapper.CruderMapper[TEntity, TModel]
}

func NewCrud

func NewCrud[TEntity any, TModel any](useCase appusecase.CruderUseCase[TEntity], mapper mapper.CruderMapper[TEntity, TModel]) *Crud[TEntity, TModel]

func (*Crud[TEntity, TModel]) GetById

func (c *Crud[TEntity, TModel]) GetById(ctx *fiber.Ctx) error

func (*Crud[TEntity, TModel]) GetFirstById

func (c *Crud[TEntity, TModel]) GetFirstById(ctx *fiber.Ctx) error

func (*Crud[TEntity, TModel]) List

func (c *Crud[TEntity, TModel]) List(ctx *fiber.Ctx) error

Jump to

Keyboard shortcuts

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