Documentation ¶
Index ¶
- type Session
- type User
- func (user *User) ChangePassword(db *sql.DB, curPw string, newPw string) (err error)
- func (user *User) Delete(db *sql.DB) (err error)
- func (user *User) Fetch(db *sql.DB) (err error)
- func (user *User) Session(db *sql.DB) (session Session, err error)
- func (user *User) StartSession(db *sql.DB) (session Session, err error)
- func (user *User) Update(db *sql.DB) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { ID int64 // record ID of session UUID string // session UUID UserID string // relevant user UUID CreatedTs time.Time // created timstamp of session }
Session structure
type User ¶
type User struct { ID int64 // record ID in database UUID string // user UUID Email string // user e-mail Name string // user name Password string // user password CreatedTs time.Time // created timstamp of user }
User structure
func GetUserByEmail ¶
GetUserByEmail --- get a user by using email and password
func (*User) ChangePassword ¶
ChangePassword --- change user password
func (*User) StartSession ¶
StartSession creates a new session for the user
Click to show internal directories.
Click to hide internal directories.