/tasky

simple task management system with command line interface

Primary LanguageGo

Task Management System

TODO

  • step1: connecting to MongoDB
  • step2: creating a CLI program
  • step3: creating a task
  • step4: show all tasks
  • step5: complete a task
  • step6: displaying pending tasks only
  • step7: displaying finished tasks only
  • step8: deleting a task

Third party packages

  1. go get go.mongodb.org/mongo-driver
  2. go get github.com/urfave/cli/v2
  3. go get gopkg.in/gookit/color.v1
  4. go get github.com/joho/godotenv

Complete a task

For completing a task we need to grab a string value from command-line in order to identify the task we wanted to update, then with some efforts over creating an appropriate query we do the trick.

List all completed tasks

Just to be clear you only need to know how to use a good query statement and all the rest is the same code as previous parts.

filter := bson.D {
    primitive.E{Key: "completed", Value: true},
}

Deleting a task

filter := bson.D{primitive.E{Key: "text", Value: text}}

Output

trailer