Documentation ¶
Index ¶
- type Entity
- type IRepository
- type OptionQuery
- type Repository
- func (r *Repository) Create(ctx *gin.Context, form Entity, dbTransaction *gorm.DB) (Entity, error)
- func (r *Repository) CustomQuery(ctx *gin.Context) *gorm.DB
- func (r *Repository) Delete(ctx *gin.Context, id int, dbTransaction *gorm.DB) error
- func (r *Repository) FindAll(ctx *gin.Context, entities any, options *OptionQuery, dbTransaction *gorm.DB) (*utils.Pagination, error)
- func (r *Repository) FindOne(ctx *gin.Context, entity Entity, id int, dbTransaction *gorm.DB) error
- func (r *Repository) Update(ctx *gin.Context, id int, form Entity, dbTransaction *gorm.DB) (Entity, error)
- type Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IRepository ¶
type IRepository interface { FindOne(ctx *gin.Context, entity Entity, id int, dbTransaction *gorm.DB) error FindAll(ctx *gin.Context, entities any, options *OptionQuery, dbTransaction *gorm.DB) (*utils.Pagination, error) Create(ctx *gin.Context, form Entity, dbTransaction *gorm.DB) (Entity, error) Update(ctx *gin.Context, id int, form Entity, dbTransaction *gorm.DB) (Entity, error) Delete(ctx *gin.Context, id int, dbTransaction *gorm.DB) error CustomQuery(ctx *gin.Context) *gorm.DB }
func NewRepository ¶
func NewRepository(entity Entity, db *gorm.DB) IRepository
type OptionQuery ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (*Repository) CustomQuery ¶
func (r *Repository) CustomQuery(ctx *gin.Context) *gorm.DB
func (*Repository) FindAll ¶
func (r *Repository) FindAll(ctx *gin.Context, entities any, options *OptionQuery, dbTransaction *gorm.DB) (*utils.Pagination, error)
type Services ¶
type Services struct { UserService IRepository TokenService IRepository }
Click to show internal directories.
Click to hide internal directories.