Discover Packages
github.com/marcuscarr/todogo
todo
package
Version:
v0.0.0-...-cb10448
Opens a new window with list of versions in this module.
Published: Apr 27, 2020
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Index
Constants
Variables
Functions
Create(db, id, title, desc, status)
Delete(db, id)
Update(db, id, title, desc, status)
Upsert(db, id, title, desc, status)
Types
Source Files
Documentation
Documentation
¶
func Create(db *sqlx.DB, id *int, title *string, desc *string, status *bool) (int, error)
func Delete(db *sqlx.DB, id int) (int, error)
func Update(db *sqlx.DB, id int, title *string, desc *string, status *bool) (int, error)
func Upsert(db *sqlx.DB, id int, title *string, desc *string, status *bool) (int, error)
type Todo
Create adds a new To-Do to the database and returns its id
Delete removes the To-Do that matches the supplied ID
Update modifies the To-Do that matches the supplied ID
Upsert will update a To-Do, if it exists, and create it otherwise. If a new To-Do is
created, it returns the ID. Otherwise, it returns -1.
type Todo struct {
ID int `db:"id"`
Title string `db:"title"`
Description string `db:"description"`
Status bool `db:"status"`
Created time .Time `db:"created"`
Modified time .Time `db:"modified"`
}
Todo is a task to be done
GetAll retrieves all To-Dos
Retrieve returns the To-Do with the supplied ID, if it exists
Source Files
¶
Click to show internal directories.
Click to hide internal directories.