models

package
v0.0.0-...-724514a Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: AGPL-3.0 Imports: 4 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 Bookmark

type Bookmark struct {
	gorm.Model
	Title   string
	Excerpt string
	User    User
	UserID  uint `gorm:"index:unique_url_user,unique"`
	Content template.HTML
	URL     string `gorm:"index:unique_url_user,unique"`
	Read    int    `gorm:"default 0"`
	Tags    []*Tag `gorm:"many2many:bookmark_tags"`
}

type Tag

type Tag struct {
	gorm.Model
	Name   string `gorm:"index:unique_tag_user,unique"`
	User   User
	UserID uint `gorm:"index:unique_tag_user,unique"`
}

type User

type User struct {
	gorm.Model
	Name           string
	Email          string `gorm:"uniqueIndex"`
	HashedPassword []byte
}

Jump to

Keyboard shortcuts

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