Documentation ¶
Index ¶
- type Mapper
- type Repository
- func (r *Repository[T]) Count(tx *gorm.DB, clause models.IClause) (int64, error)
- func (r *Repository[T]) Delete(tx *gorm.DB, entity *T) error
- func (r *Repository[T]) DeleteAll(tx *gorm.DB, entities []T) error
- func (r *Repository[T]) DeleteBy(tx *gorm.DB, clause models.IClause) error
- func (r *Repository[T]) FindAll(tx *gorm.DB, clause models.IClause) ([]T, error)
- func (r *Repository[T]) FindAllComplex(tx *gorm.DB, clause models.IClause, page models.IPagination, ...) ([]T, models.IPagination, error)
- func (r *Repository[T]) FindByID(tx *gorm.DB, id uint) (*T, error)
- func (r *Repository[T]) FindOne(tx *gorm.DB, clause models.IClause) (*T, error)
- func (r *Repository[T]) Save(tx *gorm.DB, entity *T) (*T, error)
- func (r *Repository[T]) SaveAll(tx *gorm.DB, entities []T) ([]T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper[T any] struct { BeforeMap2Model func(from any) any AfterMap2Model func(from any, to *T) *T }
func (*Mapper[T]) Map2Models ¶
func (*Mapper[T]) MapModel2Model ¶
type Repository ¶
type Repository[T any] struct{}
func (*Repository[T]) DeleteAll ¶
func (r *Repository[T]) DeleteAll(tx *gorm.DB, entities []T) error
func (*Repository[T]) FindAllComplex ¶
func (r *Repository[T]) FindAllComplex(tx *gorm.DB, clause models.IClause, page models.IPagination, sort models.ISorting) ([]T, models.IPagination, error)
Click to show internal directories.
Click to hide internal directories.