repository

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package repository provides the user repository implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(db database.DB, logger logging.Logger) user.Repository

NewStore creates a new user store

Types

type Store

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

Store implements user.Repository interface

func (*Store) Count

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

Count returns the total number of users

func (*Store) Create

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

Create stores a new user

func (*Store) Delete

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

Delete removes a user by ID

func (*Store) GetActiveUsers

func (s *Store) GetActiveUsers(ctx context.Context, offset, limit int) ([]*entities.User, error)

GetActiveUsers retrieves all active users

func (*Store) GetByEmail

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

GetByEmail retrieves a user by email

func (*Store) GetByID

func (s *Store) GetByID(ctx context.Context, id string) (*entities.User, error)

GetByID retrieves a user by ID

func (*Store) GetByIDString

func (s *Store) GetByIDString(ctx context.Context, id string) (*entities.User, error)

GetByIDString retrieves a user by ID string

func (*Store) GetByRole

func (s *Store) GetByRole(ctx context.Context, role string, offset, limit int) ([]*entities.User, error)

GetByRole retrieves users by role

func (*Store) GetByUsername

func (s *Store) GetByUsername(ctx context.Context, username string) (*entities.User, error)

GetByUsername retrieves a user by username

func (*Store) GetInactiveUsers

func (s *Store) GetInactiveUsers(ctx context.Context, offset, limit int) ([]*entities.User, error)

GetInactiveUsers retrieves all inactive users

func (*Store) List

func (s *Store) List(ctx context.Context, offset, limit int) ([]*entities.User, error)

List returns all users

func (*Store) ListPaginated

func (s *Store) ListPaginated(ctx context.Context, params common.PaginationParams) common.PaginationResult

ListPaginated returns a paginated list of users

func (*Store) Search

func (s *Store) Search(ctx context.Context, query string, offset, limit int) ([]*entities.User, error)

Search searches users by name or email

func (*Store) Update

func (s *Store) Update(ctx context.Context, userModel *entities.User) error

Update updates a user

Jump to

Keyboard shortcuts

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