tasks

package
v0.0.0-...-5ad840a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB() (*sql.DB, error)

InitDB retourne la database tasks.db

Types

type Item

type Item struct {
	ID       int
	TaskItem string
	Finished int
}

Item est une tache a accomplir.

type Task

type Task struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

Task est un type qui contient la database.

func NewTask

func NewTask(db *sql.DB) *Task

NewTask crée la table et initialise la database.

func (*Task) Add

func (task *Task) Add(item Item, result chan string)

Add ajoute une nouvelle tâche.

func (*Task) Del

func (task *Task) Del(idTask int, result chan string)

Del efface une tâche avec une ID passée en paramèttre.

func (*Task) End

func (task *Task) End(idTask int, result chan string)

End marque une tâche terminée avec une ID passée en paramèttre.

func (*Task) Exists

func (task *Task) Exists(idTask int, result chan bool)

Exists check if task exists. true if exists, otherwise false.

func (*Task) Get

func (task *Task) Get(end bool) []Item

Get recupère un slice de taches.

func (*Task) GetTask

func (task *Task) GetTask(idTask int) Item

GetTask recupère une tâche par son id. TODO /: A VERIFIER !

Jump to

Keyboard shortcuts

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