usercache

package
v0.0.0-...-c4114b5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package usercache contains user related CRUD functionality with caching.

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 data and caching.

func NewStore

func NewStore(log *logger.Logger, storer userbus.Storer, ttl time.Duration) *Store

NewStore constructs the api for data and caching access.

func (*Store) Count

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

Count returns the total number of cards in the DB.

func (*Store) Create

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

Create inserts a new user into the database.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, usr userbus.User) error

Delete removes a user from the database.

func (*Store) NewWithTx

func (s *Store) NewWithTx(tx transaction.CommitRollbacker) (userbus.Storer, error)

NewWithTx 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 userbus.QueryFilter, orderBy order.By, page page.Page) ([]userbus.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) (userbus.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) (userbus.User, error)

QueryByID gets the specified user from the database.

func (*Store) Update

func (s *Store) Update(ctx context.Context, usr userbus.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