Documentation ¶
Index ¶
- type BaseRepository
- func (r *BaseRepository) BeginTransaction() *gorm.DB
- func (r *BaseRepository) Count() (int64, error)
- func (r *BaseRepository) Create(data interface{}) error
- func (r *BaseRepository) CreateWithTransaction(tx *gorm.DB, data interface{}) error
- func (r *BaseRepository) Delete(field, value string) error
- func (r *BaseRepository) DeleteWithTransaction(tx *gorm.DB, field, value string) error
- func (r *BaseRepository) FindAll(dto interface{}, results interface{}, preloads ...string) (int64, error)
- func (r *BaseRepository) FindOneByField(field string, value interface{}, preloads ...string) (interface{}, error)
- func (r *BaseRepository) Update(data interface{}) error
- func (r *BaseRepository) UpdateWithTransaction(tx *gorm.DB, data interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseRepository ¶
func NewRepository ¶
func NewRepository(db *gorm.DB, model interface{}) *BaseRepository
func (*BaseRepository) BeginTransaction ¶
func (r *BaseRepository) BeginTransaction() *gorm.DB
func (*BaseRepository) Count ¶
func (r *BaseRepository) Count() (int64, error)
func (*BaseRepository) Create ¶
func (r *BaseRepository) Create(data interface{}) error
func (*BaseRepository) CreateWithTransaction ¶
func (r *BaseRepository) CreateWithTransaction(tx *gorm.DB, data interface{}) error
func (*BaseRepository) Delete ¶
func (r *BaseRepository) Delete(field, value string) error
func (*BaseRepository) DeleteWithTransaction ¶
func (r *BaseRepository) DeleteWithTransaction(tx *gorm.DB, field, value string) error
func (*BaseRepository) FindAll ¶
func (r *BaseRepository) FindAll(dto interface{}, results interface{}, preloads ...string) (int64, error)
func (*BaseRepository) FindOneByField ¶
func (r *BaseRepository) FindOneByField(field string, value interface{}, preloads ...string) (interface{}, error)
func (*BaseRepository) Update ¶
func (r *BaseRepository) Update(data interface{}) error
func (*BaseRepository) UpdateWithTransaction ¶
func (r *BaseRepository) UpdateWithTransaction(tx *gorm.DB, data interface{}) error
Click to show internal directories.
Click to hide internal directories.