blog

package
v0.0.0-...-b2df2c4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 4 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       bson.ObjectId `bson:"_id,omitempty"`
	Content  string
	Email    string
	Approved bool
}

type Post

type Post struct {
	ID          bson.ObjectId  `bson:"_id,omitempty" json:"id"`
	Title       string         `json:"title"`
	Content     string         `json:"content"`
	AuthorID    bson.ObjectId  `bson:"authorId" json:"authorId"`
	CreatedAt   time.Time      `bson:"createdAt" json:"createdAt"`
	UpdateAt    *time.Time     `bson:"updatedAt" json:"updatedAt"`
	UpdatedByID *bson.ObjectId `bson:"updatedById" json:"updatedById"`
}

func CreatePost

func CreatePost(db *mgo.Database, post *Post) (*Post, error)

func GetPosts

func GetPosts(db *mgo.Database, skip int, limit int) ([]*Post, error)

type User

type User struct {
	ID       bson.ObjectId `bson:"_id,omitempty"`
	Name     string
	Password string
	Email    string
	IsAdmin  bool `bson:"isAdmin"`
}

Jump to

Keyboard shortcuts

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