postgres

package
v0.0.0-...-9a938bf Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(cfg config.DatabaseConfig) (*sql.DB, error)

Types

type Postgres

type Postgres struct {
	*sql.DB
}

func NewPostgresDatabase

func NewPostgresDatabase(cfg config.DatabaseConfig) (*Postgres, error)

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *Postgres) *UserRepository

func (*UserRepository) CreateUser

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

func (*UserRepository) GetUser

func (repo *UserRepository) GetUser(id int) (*models.User, error)

Jump to

Keyboard shortcuts

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