model

package
v0.0.1-alpha5 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	ID   string
	Name string
}

type User

type User struct {
	ID        string
	Username  string
	Email     string
	Password  string
	CreatedAt string `db:"created_at"`
	Confirmed bool
	// EmailConfirmedAt string `db:"email_confirmed_at"`
	// EmailSentAt string `db:"email_sent_at"`
	Roles []*Role
}

User struct represents our User model

func (*User) ComparePassword

func (user *User) ComparePassword(password string) (bool, error)

ComparePassword compare the given password with the password in db

func (*User) HashedPassword

func (user *User) HashedPassword() error

HashedPassword hash user password

type UserCredentials

type UserCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

UserCredentials holds our User credentials

Jump to

Keyboard shortcuts

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