adminrepo

package
v0.0.0-...-a9081ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package adminrepo holds the repository logic associated with the admin domain.

Index

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

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

func (r *Repository) CreateAdmin(ctx context.Context, u *ent.Admin) error

CreateAdmin create in the database an Admin with the provided information.

func (*Repository) FindAdminByID

func (r *Repository) FindAdminByID(ctx context.Context, uid uuid.UUID) (*ent.Admin, error)

FindAdminByID return an Admin found by his UUID.

func (*Repository) FindAdminByLogin

func (r *Repository) FindAdminByLogin(ctx context.Context, login string) (*ent.Admin, error)

FindAdminByLogin return an Admin found by his login.

func (*Repository) UpdateAdmin

func (r *Repository) UpdateAdmin(ctx context.Context, u *ent.Admin) error

UpdateAdmin update in the database an Admin with the provided information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL