controller

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Zlib Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageLimit int = 8
)

DefaultPageLimit is default limit number per page And other constant

Variables

This section is empty.

Functions

func ArticlesPage

func ArticlesPage(c *gin.Context)

ArticlesPage return JSON information by page number Request sample:

GET /page/1?limit=6

func DeleteArticle

func DeleteArticle(c *gin.Context)

DeleteArticle delete an articles JSON.

func DeleteOption

func DeleteOption(c *gin.Context)

DeleteOption will delete option by 'name' param Request sample:

DELETE /option/:name

func GetArticle

func GetArticle(c *gin.Context)

GetArticle get an articles by 'id' param Request sample:

GET /article/1

func GetOption

func GetOption(c *gin.Context)

GetOption return an option by 'name' param Request sample:

GET /option/:name

func HomePage

func HomePage(c *gin.Context)

HomePage return home and index page Request sample:

GET / => GET /page/1

func InsertArticle

func InsertArticle(c *gin.Context)

InsertArticle will insert an articles Request sample:

POST /article?title=foo&status=1&content=bar

func InsertOption

func InsertOption(c *gin.Context)

InsertOption will insert an option Request sample:

POST /option/:name?value=foo

func ListArticles

func ListArticles(c *gin.Context)

ListArticles return the number of all articles Request sample:

GET /articles

func ListOptions

func ListOptions(c *gin.Context)

ListOptions return all options Request sample:

GET /options

func UpdateArticle

func UpdateArticle(c *gin.Context)

UpdateArticle update an articles JSON.

func UpdateOption

func UpdateOption(c *gin.Context)

UpdateOption will update option Request sample:

PUT /option/:name?value=foo1

Types

This section is empty.

Jump to

Keyboard shortcuts

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