repository

package
v0.0.0-...-3ca1276 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 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 PostgresRepository

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

PostgresRepository is a repository that holds the database connection.

func New

func New(db *postgres.DB) *PostgresRepository

New creates a new PostgresRepository instance.

func (*PostgresRepository) AddAccount

func (r *PostgresRepository) AddAccount(ctx context.Context, account *user.Account) error

AddAccount inserts user account data to postgres database.

func (*PostgresRepository) DeleteAccount

func (r *PostgresRepository) DeleteAccount(ctx context.Context, id uuid.UUID) error

DeleteAccount removes user data from postgres database.

func (*PostgresRepository) GetAccountByEmail

func (r *PostgresRepository) GetAccountByEmail(ctx context.Context, email string) (*user.Account, error)

GetAccountByEmail retrieves user account data from postgres database by email.

func (*PostgresRepository) GetAccountByID

func (r *PostgresRepository) GetAccountByID(ctx context.Context, id uuid.UUID) (*user.Account, error)

GetAccountByID retrieves user account data from postgres database by ID.

func (*PostgresRepository) ListAccounts

func (r *PostgresRepository) ListAccounts(ctx context.Context, limit, offset int) ([]*user.Account, error)

ListAccounts retrieves a list of user accounts from postgres database.

func (*PostgresRepository) UpdateAccount

func (r *PostgresRepository) UpdateAccount(ctx context.Context, account *user.Account) error

UpdateAccount updates user account data in postgres database.

Jump to

Keyboard shortcuts

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