Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCriteriaBuilder = func(c wool.Ctx, excludeFields ...string) *repository.Criteria { criteria := db.BuildCriteria(c.Req().URL.RawQuery, excludeFields...) if criteria.Index == nil { criteria.SetIndex(0) } if criteria.Size == nil { criteria.SetSize(20) } return criteria }
Functions ¶
This section is empty.
Types ¶
type CRUD ¶
func NewCRUD ¶
func NewCRUD[CreateDTO any, UpdateDTO any, Entity repository.Entity, ResponseDTO any]( read repository.ReadRepository[Entity], write repository.WriteRepository[Entity], createDTO DTOFactory[CreateDTO], updateDTO DTOFactory[UpdateDTO], createMapper RequestMapper[CreateDTO, Entity], updateMapper RequestMapper[UpdateDTO, Entity], responseMapper ResponseMapper[Entity, ResponseDTO], ) CRUD
type CreateAction ¶
type CreateAction[DTO any, Entity repository.Entity] struct { WriteRepository repository.WriteRepository[Entity] DTOFactory DTOFactory[DTO] Mapper RequestMapper[DTO, Entity] }
type DTOFactory ¶
type DTOFactory[DTO any] interface { NewDTO() DTO }
func NewDTOFactory ¶
func NewDTOFactory[DTO any]() DTOFactory[DTO]
type DTOFactoryFunc ¶
type DTOFactoryFunc[DTO any] func() DTO
func (DTOFactoryFunc[DTO]) NewDTO ¶
func (f DTOFactoryFunc[DTO]) NewDTO() DTO
type DeleteAction ¶
type DeleteAction[Entity repository.Entity] struct { WriteRepository repository.WriteRepository[Entity] }
type ListAction ¶
type ListAction[Entity repository.Entity, DTO any] struct { ReadRepository repository.ReadRepository[Entity] ResponseMapper ResponseMapper[Entity, DTO] CriteriaBuilder func(c wool.Ctx) *repository.Criteria }
type ListResponse ¶
type RequestMapper ¶
type RequestMapperFunc ¶
type ResponseMapper ¶
type ResponseMapper[Entity repository.Entity, DTO any] interface { ToResponse(entity Entity) DTO }
type ResponseMapperFunc ¶
type ResponseMapperFunc[Entity repository.Entity, DTO any] func(entity Entity) DTO
func (ResponseMapperFunc[Entity, DTO]) ToResponse ¶
func (m ResponseMapperFunc[Entity, DTO]) ToResponse(entity Entity) DTO
type TakeAction ¶
type TakeAction[Entity repository.Entity, DTO any] struct { ReadRepository repository.ReadRepository[Entity] ResponseMapper ResponseMapper[Entity, DTO] }
type UpdateAction ¶
type UpdateAction[DTO any, Entity repository.Entity] struct { WriteRepository repository.WriteRepository[Entity] DTOFactory DTOFactory[DTO] Mapper RequestMapper[DTO, Entity] }
func (*UpdateAction[DTO, Entity]) PartiallyUpdate ¶
func (a *UpdateAction[DTO, Entity]) PartiallyUpdate(c wool.Ctx) error
Click to show internal directories.
Click to hide internal directories.