userdb

package
v0.0.0-...-c2300e3 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package userdb contains user related CRUD functionality.

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) Create

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

Create inserts a new user into the database.

func (*Store) QueryByID

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

QueryByID gets the specified user from the database.

func (*Store) QueryByIDs

func (s *Store) QueryByIDs(ctx context.Context, ids []uuid.UUID) ([]user.User, error)

QueryByIDs gets the specified users from the database.

func (*Store) QueryByPhone

func (s *Store) QueryByPhone(ctx context.Context, phone string) (user.User, error)

QueryByPhone gets the specified user from the database by email.

func (*Store) Update

func (s *Store) Update(ctx context.Context, core user.User) error

Update replaces a user document in the database.

Jump to

Keyboard shortcuts

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