userdb

package
v0.0.0-...-22b2db2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages the set of APIs for user database access.

func NewStore

func NewStore(log *logger.Logger, db *sqlx.DB) *Store

NewStore constructs the api for data access.

func (*Store) Count

func (s *Store) Count(ctx context.Context, filter user.QueryFilter) (int, error)

Count returns the total number of users in the DB.

func (*Store) Create

func (s *Store) Create(ctx context.Context, usr user.User) error

Create inserts a new user into the database.

func (*Store) ExecuteUnderTransaction

func (s *Store) ExecuteUnderTransaction(tx transaction.Transaction) (user.Storer, error)

ExecuteUnderTransaction constructs a new Store value replacing the sqlx DB value with a sqlx DB value that is currently inside a transaction.

func (*Store) Query

func (s *Store) Query(ctx context.Context, filter user.QueryFilter, orderBy order.By, pageNumber int, rowsPerPage int) ([]user.User, error)

Query retrieves a list of existing users from the database.

func (*Store) QueryByEmail

func (s *Store) QueryByEmail(ctx context.Context, email mail.Address) (user.User, error)

QueryByEmail gets the specified user from the database by email.

func (*Store) QueryByID

func (s *Store) QueryByID(ctx context.Context, userID uuid.UUID) (user.User, error)

QueryByID gets the specified user from the database.

Jump to

Keyboard shortcuts

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