Documentation ¶
Overview ¶
Package note provides access to the note table in the MySQL database.
Index ¶
- func ByUserIDCount(db Connection, userID string) (int, error)
- func Create(db Connection, name string, userID string) (sql.Result, error)
- func DeleteHard(db Connection, ID string, userID string) (sql.Result, error)
- func DeleteSoft(db Connection, ID string, userID string) (sql.Result, error)
- func Update(db Connection, name string, ID string, userID string) (sql.Result, error)
- type Connection
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByUserIDCount ¶
func ByUserIDCount(db Connection, userID string) (int, error)
ByUserIDCount counts the number of items for a user.
func DeleteHard ¶
DeleteHard removes an item.
func DeleteSoft ¶
DeleteSoft marks an item as removed.
Types ¶
type Connection ¶
type Connection interface { Exec(query string, args ...interface{}) (sql.Result, error) Get(dest interface{}, query string, args ...interface{}) error Select(dest interface{}, query string, args ...interface{}) error }
Connection is an interface for making queries.
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 ByUserID ¶
func ByUserID(db Connection, userID string) ([]Item, bool, error)
ByUserID gets all items for a user.
func ByUserIDPaginate ¶
ByUserIDPaginate gets items for a user based on page and max variables.
Click to show internal directories.
Click to hide internal directories.