models

package
v0.0.0-...-b135e4b Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRecord           = errors.New("models: no matching record found")
	ErrInvalidCredentials = errors.New("models: invalid credentials")
	ErrDuplicateEmail     = errors.New("models: duplicate email")
)

Functions

This section is empty.

Types

type Scratch

type Scratch struct {
	ID      int
	Title   string
	Content string
	Created time.Time
	Expires time.Time
}

type Scratches

type Scratches interface {
	Insert(string, string, string) (int, error)
	Get(int) (*Scratch, error)
	Latest() ([]*Scratch, error)
}

type User

type User struct {
	ID             int
	Name           string
	Email          string
	HashedPassword []byte
	Created        time.Time
	Active         bool
}

type Users

type Users interface {
	Insert(string, string, string) error
	Authenticate(string, string) (int, error)
	Get(int) (*User, error)
	ChangePassword(int, string, string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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