database

package
v0.0.0-...-7571f08 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sqlx.DB
}

func New

func New(dsn string, automigrate bool) (*DB, error)

func (*DB) GetUser

func (db *DB) GetUser(id int) (*User, bool, error)

func (*DB) GetUserByEmail

func (db *DB) GetUserByEmail(email string) (*User, bool, error)

func (*DB) InsertUser

func (db *DB) InsertUser(email, hashedPassword string) (int, error)

func (*DB) UpdateUserHashedPassword

func (db *DB) UpdateUserHashedPassword(id int, hashedPassword string) error

type User

type User struct {
	ID             int       `db:"id"`
	Created        time.Time `db:"created"`
	Email          string    `db:"email"`
	HashedPassword string    `db:"hashed_password"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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