controller

package
v0.0.0-...-df1a2eb Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TXHandler

func TXHandler(c *gin.Context, db *sqlx.DB, f func(*sqlx.Tx) error)

TXHandler is handler for working with transaction. This is wrapper function for commit and rollback.

Types

type Todo

type Todo struct {
	DB *sqlx.DB
}

Todo はTodoへのリクエストに関する制御をします

func (*Todo) Delete

func (t *Todo) Delete(c *gin.Context)

func (*Todo) DeleteMulti

func (t *Todo) DeleteMulti(c *gin.Context)

func (*Todo) Get

func (t *Todo) Get(c *gin.Context)

GetはDBからユーザを取得して結果を返します

func (*Todo) Post

func (t *Todo) Post(c *gin.Context)

PostはタスクをDBに追加します todoをJSONとして受け取ることを想定しています。

func (*Todo) Put

func (t *Todo) Put(c *gin.Context)

func (*Todo) Toggle

func (t *Todo) Toggle(c *gin.Context)

func (*Todo) ToggleAll

func (t *Todo) ToggleAll(c *gin.Context)

Jump to

Keyboard shortcuts

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