todolist

command module
v0.0.0-...-65fdc5a Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

TODO App CLI

Overview

This is a CLI app for managing tasks through the CLI based on cobra.

Todolist provides the following commands:

  • add – Add a task to the list. Command argument should be the task name.
  • done – Mark a task as done. Command argument should be task ID, starting from 1.
  • undone – Mark task as not done. Command argument should be task ID, starting from 1.
  • list – List the tasks that have not been done.
  • cleanup – Remove from the store all tasks marked as done.

Example usage of the app:

$ todolist help

Usage:
    todolist [command]
Available Commands:
    add Add task to the list
    cleanup Cleanup done tasks
    done Mark task as done
    help Help about any command
        list List all tasks still to do
    undone Mark task as not done
Flags:
    -h, --help help for todolist
Use "todolist [command] --help" for more information about a command.

Code structure

code base consists of four layers:

  • infra a.k.a. "frameworks and drivers" layer contains the tools required to connect to external services such as caching servers, databases, etc.
  • delivery a.k.a. "controllers/presenters/gateways" contains the code responsible to to convert the received data in format that the use cases accept, send it to them, and return the response in a correct format.
  • use case layer contains the application business rules logic. Here are located all services of the package.

Application Logic

the CLI app eventually saves and deletes the data from db.csv which acts as the database for the tasks the data is saved in each row in the following form: id,description,active,deleted

Running the app

Run the following command before running todolist command.

  • go get
  • go install

Testing the app

  • ginkgo -race -tags e2e ./...

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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