repository

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	User UserRepository
}

func NewRepository

func NewRepository() *Repository

type UserRepository

type UserRepository interface {
	GetUsers(ctx context.Context) ([]model.User, error)
	GetUsersWithPagination(ctx context.Context, limit int, offset int) ([]model.User, error)
	AddUser(ctx context.Context, user model.User) (id int, err error)
}

func NewUserRepository

func NewUserRepository(pgxPool *pgxpool.Pool, redisClient *redis.Client) UserRepository

type UserRepositoryImpl

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

func (*UserRepositoryImpl) AddUser

func (u *UserRepositoryImpl) AddUser(ctx context.Context, user model.User) (id int, err error)

Add user with transaction and return id

func (*UserRepositoryImpl) GetUsers

func (u *UserRepositoryImpl) GetUsers(ctx context.Context) ([]model.User, error)

func (*UserRepositoryImpl) GetUsersWithPagination

func (u *UserRepositoryImpl) GetUsersWithPagination(ctx context.Context, limit int, offset int) ([]model.User, error)

Work in progress

Jump to

Keyboard shortcuts

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