Documentation
¶
Index ¶
- type Repository
- type UnitOfWork
- func (u *UnitOfWork) Add(name string, repository Repository)
- func (u *UnitOfWork) CommitOrRollback() error
- func (u *UnitOfWork) Do(ctx context.Context, fn func(unitOfWork *UnitOfWork) error) error
- func (u *UnitOfWork) GetRepository(ctx context.Context, name string) (interface{}, error)
- func (u *UnitOfWork) Remove(name string)
- func (u *UnitOfWork) RollBack() error
- type UnitOfWorkInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type UnitOfWork ¶
func NewUnitOfWork ¶
func NewUnitOfWork(ctx context.Context, db *sql.DB) *UnitOfWork
func (*UnitOfWork) Add ¶
func (u *UnitOfWork) Add(name string, repository Repository)
func (*UnitOfWork) CommitOrRollback ¶
func (u *UnitOfWork) CommitOrRollback() error
func (*UnitOfWork) Do ¶
func (u *UnitOfWork) Do(ctx context.Context, fn func(unitOfWork *UnitOfWork) error) error
func (*UnitOfWork) GetRepository ¶
func (u *UnitOfWork) GetRepository(ctx context.Context, name string) (interface{}, error)
func (*UnitOfWork) Remove ¶
func (u *UnitOfWork) Remove(name string)
func (*UnitOfWork) RollBack ¶
func (u *UnitOfWork) RollBack() error
type UnitOfWorkInterface ¶
Click to show internal directories.
Click to hide internal directories.