Documentation ¶
Overview ¶
Package adminrepo holds the repository logic associated with the admin domain.
Index ¶
- type AtomicRepository
- type Repository
- func (r *Repository) CreateAdmin(ctx context.Context, u *ent.Admin) error
- func (r *Repository) FindAdminByID(ctx context.Context, uid uuid.UUID) (*ent.Admin, error)
- func (r *Repository) FindAdminByLogin(ctx context.Context, login string) (*ent.Admin, error)
- func (r *Repository) UpdateAdmin(ctx context.Context, u *ent.Admin) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicRepository ¶
type AtomicRepository struct {
// contains filtered or unexported fields
}
AtomicRepository satisfies adminservice.AtomicRepository.
func NewAtomic ¶
func NewAtomic(db *ent.Client) *AtomicRepository
NewAtomic instantiates a new AtomicRepository using the database provided.
func (*AtomicRepository) Execute ¶
func (ar *AtomicRepository) Execute( ctx context.Context, op adminservice.AtomicOperation, ) error
Execute decorates the given AtomicOperation with a transaction. If the AtomicOperation returns an error, the transaction is rolled back. Otherwise, the transaction is committed.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository satisfies adminservice.Repository. It is agnostic whether its sql.TableOperator is a database or transaction.
func (*Repository) CreateAdmin ¶
CreateAdmin create in the database an Admin with the provided information.
func (*Repository) FindAdminByID ¶
FindAdminByID return an Admin found by his UUID.
func (*Repository) FindAdminByLogin ¶
FindAdminByLogin return an Admin found by his login.
func (*Repository) UpdateAdmin ¶
UpdateAdmin update in the database an Admin with the provided information