db

package
v0.0.0-...-0f9ccff Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	SaveUser(ctx context.Context, user *models.User) (*models.User, error)
	GetAllUsers(ctx context.Context) ([]models.User, error)
	DeleteUser(ctx context.Context, id uint) error
	GetUserByID(ctx context.Context, id uint) (*models.User, error)
	GetUserByUsername(ctx context.Context, username string) (*models.User, error)
}

type PgDB

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

func NewPgDB

func NewPgDB(db *gorm.DB) *PgDB

func (*PgDB) DeleteUser

func (d *PgDB) DeleteUser(ctx context.Context, id uint) error

func (*PgDB) GetAllUsers

func (d *PgDB) GetAllUsers(ctx context.Context) ([]models.User, error)

func (*PgDB) GetUserByID

func (d *PgDB) GetUserByID(ctx context.Context, id uint) (*models.User, error)

func (*PgDB) GetUserByUsername

func (d *PgDB) GetUserByUsername(ctx context.Context, username string) (*models.User, error)

func (*PgDB) SaveUser

func (d *PgDB) SaveUser(ctx context.Context, user *models.User) (*models.User, error)

Jump to

Keyboard shortcuts

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