Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository( logger *log.Logger, db *gorm.DB, ) *Repository
func (*Repository) DB ¶
func (r *Repository) DB(ctx context.Context) *gorm.DB
DB return tx If you need to create a Transaction, you must call DB(ctx) and Transaction(ctx,fn)
func (*Repository) Transaction ¶
type Transaction ¶
type Transaction interface {
Transaction(ctx context.Context, fn func(ctx context.Context) error) error
}
func NewTransaction ¶
func NewTransaction(r *Repository) Transaction
type UserRepository ¶
type UserRepository interface { Create(ctx context.Context, user *model.User) error Update(ctx context.Context, user *model.User) error GetByID(ctx context.Context, id string) (*model.User, error) GetByEmail(ctx context.Context, email string) (*model.User, error) }
func NewUserRepository ¶
func NewUserRepository( r *Repository, ) UserRepository
Click to show internal directories.
Click to hide internal directories.