store

package
v0.0.0-...-0077de9 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateID       = errors.New("id already exists")
	ErrDuplicateUsername = errors.New("username already exists")
	ErrNoRows            = errors.New("row not exists")
	ErrUpdateFailed      = errors.New("update failed")
	ErrDeleteFailed      = errors.New("delete failed")
)

Functions

This section is empty.

Types

type Respository

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

func NewRespository

func NewRespository(db *pgxpool.Pool) *Respository

func (*Respository) AllIDs

func (DB *Respository) AllIDs() ([]int64, error)

AllIDs returns a slice of all user id and an error

func (*Respository) Delete

func (DB *Respository) Delete(id int64) error

func (*Respository) Insert

func (DB *Respository) Insert(userID int64, userUsername string) error

func (*Respository) IsUser

func (DB *Respository) IsUser(id int64) bool

IsUser returns true if user is found in the db and false otherwise.

func (*Respository) Migrate

func (DB *Respository) Migrate() error

type USER

type USER struct {
	ID       int64
	Username string
}

Jump to

Keyboard shortcuts

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