models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	ID        int64
	Body      string
	Commenter string
	PostID    int // Foreign key for Post (belongs to)
	CreatedAt time.Time
	UpdatedAt time.Time
}

Comment is

type Post

type Post struct {
	ID        int64
	Title     string
	Body      string
	CreatedAt time.Time
	UpdatedAt time.Time
	Comments  []Comment     // One-To-Many relationship (has many)
	HTMLBody  template.HTML `sql:"-"`
}

Post is

type User

type User struct {
	ID       int64
	Name     string
	Role     string
	Username string
	Password []byte
}

User is

Jump to

Keyboard shortcuts

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