Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TxnDataSQL ¶
type TxnDataSQL struct {
// contains filtered or unexported fields
}
TxnDataSQL manages the transaction by implementing the Transaction Manager interface
func NewTxnDataSQL ¶
func NewTxnDataSQL(db *gorm.DB) *TxnDataSQL
NewTxnDataSQL is the contructor function
func (*TxnDataSQL) GetTxn ¶
func (tds *TxnDataSQL) GetTxn(ctx context.Context) interface{}
GetTxn to get the current transaction of this service
func (*TxnDataSQL) TxnBegin ¶
func (tds *TxnDataSQL) TxnBegin(ctx context.Context) context.Context
TxnBegin begin a new transaction
func (*TxnDataSQL) TxnCommit ¶
func (tds *TxnDataSQL) TxnCommit(ctx context.Context) (err error)
TxnCommit commit a transaction
func (*TxnDataSQL) TxnRollback ¶
func (tds *TxnDataSQL) TxnRollback(ctx context.Context) (err error)
TxnRollback rollback a transaction
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository repository struct implement the User Repository interface
func NewUserRepository ¶
func NewUserRepository() *UserRepository
NewUserRepository creates the new instance of User Repository
func (*UserRepository) Create ¶
func (r *UserRepository) Create(ctx context.Context, ent entity.User) (created entity.User, err error)
Create method to call DB to create the new user
Click to show internal directories.
Click to hide internal directories.