db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPgConnectionPool

func NewPgConnectionPool(c config.Config) (*pgxpool.Pool, error)

Types

type Database

type Database struct {
	Conn *pgxpool.Pool
}

func NewDatabase

func NewDatabase(c config.Config) *Database

type PostgresUserRepository

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

func NewUserRepository

func NewUserRepository(db *Database) (*PostgresUserRepository, error)

func (PostgresUserRepository) CreateUser

func (repo PostgresUserRepository) CreateUser(user *models.User) (*models.User, error)

func (PostgresUserRepository) GetUser

func (repo PostgresUserRepository) GetUser(id string) (*models.User, error)

type UserRepository

type UserRepository interface {
	CreateUser(user *models.User) (*models.User, error)
	GetUser(id string) (*models.User, error)
}

Jump to

Keyboard shortcuts

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