Documentation
¶
Index ¶
- type PostgresRepository
- func (r *PostgresRepository) AddAccount(ctx context.Context, account *user.Account) error
- func (r *PostgresRepository) DeleteAccount(ctx context.Context, id uuid.UUID) error
- func (r *PostgresRepository) GetAccountByEmail(ctx context.Context, email string) (*user.Account, error)
- func (r *PostgresRepository) GetAccountByID(ctx context.Context, id uuid.UUID) (*user.Account, error)
- func (r *PostgresRepository) ListAccounts(ctx context.Context, limit, offset int) ([]*user.Account, error)
- func (r *PostgresRepository) UpdateAccount(ctx context.Context, account *user.Account) error
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 ¶
AddAccount inserts user account data to postgres database.
func (*PostgresRepository) DeleteAccount ¶
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 ¶
UpdateAccount updates user account data in postgres database.
Click to show internal directories.
Click to hide internal directories.