dbuser

package
v0.0.0-...-8bbd0fc Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(u *User) error

Delete deletes a user from the database

func Insert

func Insert(u *User) error

Insert will create a new record in the database

func Save

func Save(s *User) error

func Update

func Update(s *User) error

Update will update a record in the database

Types

type User

type User struct {
	PersonID      int64               `db:"person_id"`
	Email         string              `db:"email"`
	Username      database.NullString `db:"username"`
	UserPassword  database.NullString `db:"person_password"`
	FirstName     string              `db:"first_name"`
	LastName      database.NullString `db:"last_name"`
	Cell          database.NullString `db:"cell"`
	CreatedDate   time.Time           `db:"created_date"`
	LastLoginDate database.NullTime   `db:"last_login_date"`
}

func ReadAll

func ReadAll() ([]User, error)

ReadAll reads all users in the database

func ReadByID

func ReadByID(ID int64) (*User, error)

ReadByID reads user by id column

func ReadByUsername

func ReadByUsername(username string) (*User, error)

ReadByUsername reads user by username column

Jump to

Keyboard shortcuts

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