store

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound is returned when a user cannot be found in the store
	ErrUserNotFound = errors.New("user not found")
)

Functions

func NewStore

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

NewStore creates a new user store

func NewUserStore

func NewUserStore(db *database.Database, logger logging.Logger) user.Store

NewUserStore creates a new user store

Types

type Store

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

Store implements the user.Store interface using a SQL database

func (*Store) Create

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

Create inserts a new user into the database

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id uint) error

Delete removes a user from the database

func (*Store) GetByEmail

func (s *Store) GetByEmail(ctx context.Context, email string) (*user.User, error)

GetByEmail retrieves a user by email

func (*Store) GetByID

func (s *Store) GetByID(ctx context.Context, id uint) (*user.User, error)

GetByID retrieves a user by ID

func (*Store) GetUserIDs

func (s *Store) GetUserIDs(ctx context.Context) ([]string, error)

GetUserIDs retrieves all user IDs from the store

func (*Store) List

func (s *Store) List(ctx context.Context) ([]user.User, error)

List returns all users from the database

func (*Store) Update

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

Update modifies an existing user in the database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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