note

package
v0.0.0-...-b76ee76 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package note provides access to the note table in the MySQL database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(name string, userID string) (sql.Result, error)

Create adds an item.

func Delete

func Delete(ID string, userID string) (sql.Result, error)

Delete marks an item as removed.

func DeleteHard

func DeleteHard(ID string, userID string) (sql.Result, error)

DeleteHard removes an item.

func Update

func Update(name string, ID string, userID string) (sql.Result, error)

Update makes changes to an existing item.

Types

type Item

type Item struct {
	ID        uint32         `db:"id"`
	Name      string         `db:"name"`
	UserID    uint32         `db:"user_id"`
	CreatedAt mysql.NullTime `db:"created_at"`
	UpdatedAt mysql.NullTime `db:"updated_at"`
	DeletedAt mysql.NullTime `db:"deleted_at"`
}

Item defines the model.

func ByID

func ByID(ID string, userID string) (Item, error)

ByID gets item by ID.

func ByUserID

func ByUserID(userID string) ([]Item, error)

ByUserID gets all entities for a user.

Jump to

Keyboard shortcuts

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