Documentation
¶
Index ¶
- type BaseRepository
- func (r *BaseRepository) Begin(ctx context.Context, isolationLvl sql.IsolationLevel) (context.Context, error)
- func (r *BaseRepository) Commit(ctx context.Context) error
- func (r *BaseRepository) GetReadDB(ctx context.Context) *gorm.DB
- func (r *BaseRepository) GetTx(ctx context.Context) *gorm.DB
- func (r *BaseRepository) IsDuplicateKeyError(err error) bool
- func (r *BaseRepository) IsNotFoundError(err error) bool
- func (r *BaseRepository) Rollback(ctx context.Context) error
- func (r *BaseRepository) WithTransaction(ctx context.Context, fn func(txCtx context.Context) error) error
- type Database
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseRepository ¶
type BaseRepository struct {
// contains filtered or unexported fields
}
func NewBaseRepository ¶
func NewBaseRepository(db Database) *BaseRepository
func (*BaseRepository) Begin ¶
func (r *BaseRepository) Begin( ctx context.Context, isolationLvl sql.IsolationLevel, ) (context.Context, error)
func (*BaseRepository) IsDuplicateKeyError ¶
func (r *BaseRepository) IsDuplicateKeyError(err error) bool
func (*BaseRepository) IsNotFoundError ¶
func (r *BaseRepository) IsNotFoundError(err error) bool
func (*BaseRepository) WithTransaction ¶
Click to show internal directories.
Click to hide internal directories.