model

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TodosDeleteAll

func TodosDeleteAll(tx *sqlx.Tx) (sql.Result, error)

TodosDeleteAllはすべてのタスクを消去します。 テストのために使用されます。

func TodosToggleAll

func TodosToggleAll(tx *sqlx.Tx, checked bool) (sql.Result, error)

TodosToggleAllは全部のtoggleのステータスをトグルします

Types

type Todo

type Todo struct {
	ID        int64      `db:"todo_id" json:"id"`
	Title     string     `json:"title"`
	Completed bool       `json:"completed"`
	Created   *time.Time `json:"created"`
	Updated   *time.Time `json:"updated"`
}

Todoは管理するタスク

func TodoOne

func TodoOne(dbx *sqlx.DB, id int64) (*Todo, error)

func TodosAll

func TodosAll(dbx *sqlx.DB) (todos []Todo, err error)

func (*Todo) Delete

func (t *Todo) Delete(tx *sqlx.Tx) (sql.Result, error)

func (*Todo) Insert

func (t *Todo) Insert(tx *sqlx.Tx) (sql.Result, error)

func (*Todo) Toggle

func (t *Todo) Toggle(tx *sqlx.Tx) (sql.Result, error)

Toggle は指定されたタスクについて現在の状態と入れ替えます。

func (*Todo) Update

func (t *Todo) Update(tx *sqlx.Tx) (sql.Result, error)

Jump to

Keyboard shortcuts

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