model

package
v0.0.0-...-c938c57 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Users Users
}

Model represents the database model and contains table queries.

func New

func New(db *sql.DB) *Model

New creates a new model instance.

type User

type User struct {
	UUID     string `json:"uuid"`
	Email    string `json:"email"`
	Verified bool   `json:"verified"`
	Hash     string `json:"-"`
}

User is a user.

type Users

type Users interface {
	Add(email, password string) (*User, error)
	Authenticate(email, password string) (*User, error)
	ChangeVerified(uuid string, value bool) error
	ChangeHash(email, password, newPassword string) error
}

Users interface is implemented by the "users" struct.

Jump to

Keyboard shortcuts

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