models

package
v0.0.0-...-08ff5bc Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2016 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	UserReader int8 = 1
	UserAuthor int8 = 3
	UserAdmin  int8 = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Name        string `json:"name"`
	Description string `datastore:",noindex" json:"description,omitempty"`
}

type Comment

type Comment struct {
	Content   string    `datastore:",noindex" json:"content"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Author    User      `datastore:",noindex" json:"user"`
	Replies   []Comment `datastore:",noindex" json:"replies"`
}

type ExpandedPost

type ExpandedPost struct {
	Data     SummarizedPost `json:"data"`
	Body     string         `datastore:",noindex" json:"body"`
	Comments []Comment      `json:"comments"`
}

type SummarizedPost

type SummarizedPost struct {
	Title      string    `json:"title"`
	Slug       string    `json:"slug"`
	Summary    string    `datastore:",noindex" json:"summary"`
	CreatedAt  time.Time `json:"createdAt"`
	PostedAt   time.Time `json:"postedAt"`
	UpdatedAt  time.Time `json:"updatedAt"`
	AuthorId   string    `json:"authorId"`
	CategoryId string    `json:"categoryId"`
	Tags       []Tag     `json:"tags"`
}

type Tag

type Tag struct {
	Name string `json:"name"`
}

type User

type User struct {
	Username  string `datastore:"-", json:"username"`
	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`
	Email     string `json:"email"`
	Password  []byte `datastore:",noindex" json:"-"`
	Level     int8   `json:"-"`
	Website   string `datastore:",noindex" json:"website,omitempty"`
	Moto      string `datastore:",noindex" json:"moto,omitempty"`
}

Jump to

Keyboard shortcuts

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