data

package
v0.0.0-...-c2641ad Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: MIT Imports: 2 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 {
	ID      int    `json:"id"`
	Content string `json:"content"`
	Author  string `json:"author"`
}

Post is the post struct

func Retrieve

func Retrieve(id int) (post Post, err error)

Retrieve returns a post of id id

func (*Post) Create

func (post *Post) Create() (err error)

Create adds a post to the db

func (*Post) Delete

func (post *Post) Delete() (err error)

Delete removes a post from the db

func (*Post) Update

func (post *Post) Update() (err error)

Update updates the content of a post in the db

Jump to

Keyboard shortcuts

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