postgres

package
v0.0.0-...-37e2b78 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
	Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
}

type MemeRepositoryPostgres

type MemeRepositoryPostgres struct {
	Conn Conn
}

func (*MemeRepositoryPostgres) Delete

func (mrp *MemeRepositoryPostgres) Delete(id uuid.UUID) error

func (*MemeRepositoryPostgres) GetAll

func (mrp *MemeRepositoryPostgres) GetAll() ([]domain.Meme, error)

func (*MemeRepositoryPostgres) GetById

func (mrp *MemeRepositoryPostgres) GetById(id uuid.UUID) (domain.Meme, error)

func (*MemeRepositoryPostgres) Insert

func (mrp *MemeRepositoryPostgres) Insert(meme domain.Meme) error

func (*MemeRepositoryPostgres) Update

func (mrp *MemeRepositoryPostgres) Update(meme domain.Meme, userId uuid.UUID) error

type UserRepositoryPostgres

type UserRepositoryPostgres struct {
	Conn Conn
}

func (*UserRepositoryPostgres) GetById

func (urp *UserRepositoryPostgres) GetById(id uuid.UUID) (domain.User, error)

func (*UserRepositoryPostgres) GetByUsername

func (urp *UserRepositoryPostgres) GetByUsername(username string) (domain.User, error)

func (*UserRepositoryPostgres) Insert

func (urp *UserRepositoryPostgres) Insert(user domain.User) error

Jump to

Keyboard shortcuts

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