db

package
v0.0.0-...-b704180 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTodo

func CreateTodo(todo string) (int, error)

CreateTodo creates a new Todo struct and returns the id of that struct.

func DeleteTodos

func DeleteTodos(key int) error

DeleteTodos deletes a todo with the provided key from DB.

func Init

func Init(dbPath string) error

Init initializes a new database connection to the database located on dbPath. If no database is available at the path, a new database will be created.

Types

type Todo

type Todo struct {
	Key   int
	Value string
}

func AllTodos

func AllTodos() ([]Todo, error)

AllTodos return all todos inside the DB.

Jump to

Keyboard shortcuts

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