models

package
v0.0.0-...-d6acb80 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2016 License: GPL-2.0 Imports: 3 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 {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time
}

Base model, inherited by others

type Post

type Post struct {
	gorm.Model // inherits Model struct
	Title      string
	Body       string
	Author     string
	Tags       []Tag
}

Posts table

type Tag

type Tag struct {
	gorm.Model
	Post   Post
	PostID uint
}

Tag table, one table for each tag

type User

type User struct {
	gorm.Model
	Username     string
	PasswordHash string
}

Jump to

Keyboard shortcuts

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