Documentation ¶
Index ¶
- type Repository
- func (r *Repository) Create(target any) error
- func (r *Repository) DBWithPreloads(preloads []string) *gorm.DB
- func (r *Repository) Delete(target any, id int32) error
- func (r *Repository) FindAll(target any, preloads ...string) error
- func (r *Repository) FindById(target any, id int32, preloads ...string) error
- func (r *Repository) HandleError(res *gorm.DB) error
- func (r *Repository) Update(target any) error
- func (r *Repository) UpdateColumn(target any, id int32, column string, value any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *gorm.DB, joins ...string) *Repository
func (*Repository) Create ¶
func (r *Repository) Create(target any) error
func (*Repository) DBWithPreloads ¶
func (r *Repository) DBWithPreloads(preloads []string) *gorm.DB
func (*Repository) FindById ¶
func (r *Repository) FindById(target any, id int32, preloads ...string) error
func (*Repository) HandleError ¶
func (r *Repository) HandleError(res *gorm.DB) error
func (*Repository) Update ¶
func (r *Repository) Update(target any) error
func (*Repository) UpdateColumn ¶
Click to show internal directories.
Click to hide internal directories.