post

package
v0.0.0-...-765978f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Title       string    `json:"title"`
	Content     string    `json:"content"`
	Created     time.Time `json:"created"`
	PublishTime time.Time `json:"publish_time"`
	Status      string    `json:"status"`
	UserId      int       `json:"user_id"`
}

func CreatePost

func CreatePost(*Post) (*Post, error)

CreatePost creates a new Post

func (*Post) Save

func (p *Post) Save() (*Post, error)

Save or p.Save creates or update a Post

type PostAdapter

type PostAdapter struct {
	Title       string    `json:"p.title"`
	Content     string    `json:"p.content"`
	Created     time.Time `json:"p.created"`
	Updated     time.Time `json:"p.updated"`
	PublishTime time.Time `json:"p.publish_time"`
	Status      string    `json:"p.status"`
	UserId      int       `json:"id(u)"`
}

func (*PostAdapter) Transform

func (pa *PostAdapter) Transform() *Post

Transform transform a PostAdapter into a Post struct

Jump to

Keyboard shortcuts

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