post

package
v0.0.0-...-61dd45f Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(w http.ResponseWriter, r *http.Request)

Create new post

func Delete

func Delete(w http.ResponseWriter, r *http.Request)

Delete removes a post

func Index

func Index(w http.ResponseWriter, r *http.Request)

Index shows all posts

func Route

func Route(w http.ResponseWriter, r *http.Request)

Route is used to route methods for individual user actions

func Show

func Show(w http.ResponseWriter, r *http.Request)

Show displays a single post

func Update

func Update(w http.ResponseWriter, r *http.Request)

Update updates one record

Types

type Message

type Message struct {
	Type    string
	Message string
}

Message describes the JSON object message

type Post

type Post struct {
	gorm.Model
	Title   string
	Date    string `gorm:"type:varchar(256)"`
	Tags    string
	Author  string
	Content string `gorm:"type:varchar(256)"`
}

Post describes the database schema

Jump to

Keyboard shortcuts

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