repository

package
v0.0.0-...-2574a71 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountedUserDTO

type CountedUserDTO struct {
	ID         uint64 `db:"id"`
	Name       string `db:"name"`
	TotalCount uint64 `db:"total_count"`
}

func (CountedUserDTO) ToModel

func (dto CountedUserDTO) ToModel() models.User

type SqlxRepository

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

func NewSqlx

func NewSqlx(db *sqlx.DB, logger *slog.Logger) *SqlxRepository

func (*SqlxRepository) CreateUser

func (r *SqlxRepository) CreateUser(ctx context.Context, name string) (id uint64, err error)

func (*SqlxRepository) DeleteUser

func (r *SqlxRepository) DeleteUser(ctx context.Context, id uint64) error

func (*SqlxRepository) GetUser

func (r *SqlxRepository) GetUser(ctx context.Context, id uint64) (user models.User, found bool, err error)

func (*SqlxRepository) GetUsers

func (r *SqlxRepository) GetUsers(ctx context.Context, limit, offset uint64) ([]models.User, uint64, error)

func (*SqlxRepository) GetUsersByEvent

func (r *SqlxRepository) GetUsersByEvent(ctx context.Context, eventID, limit, offset uint64) ([]models.User, uint64, error)

func (*SqlxRepository) HealthCheck

func (r *SqlxRepository) HealthCheck(ctx context.Context) error

func (*SqlxRepository) UpdateUser

func (r *SqlxRepository) UpdateUser(ctx context.Context, user models.User) (found bool, err error)

type UserDTO

type UserDTO struct {
	ID   uint64 `db:"id"`
	Name string `db:"name"`
}

func (UserDTO) ToModel

func (dto UserDTO) ToModel() models.User

type UsersDTO

type UsersDTO []CountedUserDTO

func (UsersDTO) ToModel

func (dto UsersDTO) ToModel() ([]models.User, uint64)

Jump to

Keyboard shortcuts

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