chore: splitting monolith into packages

This commit is contained in:
2026-04-02 17:22:55 +02:00
parent 3d61c78c35
commit be1dd05d9b
9 changed files with 171 additions and 116 deletions

20
commands/add_task.go Normal file
View File

@@ -0,0 +1,20 @@
package commands
import (
"fmt"
"gotask-cli/models"
"time"
)
func AddTask(desc string, backlog []models.Task) []models.Task {
newtask := models.Task{
Id: uint(len(backlog)) + 1,
Description: desc,
Status: 0,
Created: time.Now().Unix(),
Updated: -1}
fmt.Printf("New task \"%s\" added to do @ id=%d", newtask.Description, newtask.Id)
backlog = append(backlog, newtask)
return backlog
}

9
commands/help.go Normal file
View File

@@ -0,0 +1,9 @@
package commands
import (
"fmt"
)
func Help() {
fmt.Println("Hang in there, will do the help stuff some day !")
}

10
commands/list_tasks.go Normal file
View File

@@ -0,0 +1,10 @@
package commands
import (
"gotask-cli/models"
"gotask-cli/utils"
)
func ListTasks(backlog []models.Task) {
utils.PrintTasksAsATable(backlog)
}