aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--todo.go28
-rw-r--r--todolist/file_store.go (renamed from file_store.go)0
-rw-r--r--todolist/file_store_test.go (renamed from file_store_test.go)0
-rw-r--r--todolist/parser.go (renamed from parser.go)0
-rw-r--r--todolist/parser_test.go (renamed from parser_test.go)0
-rw-r--r--todolist/store.go (renamed from store.go)0
-rw-r--r--todolist/todo_item.go22
-rw-r--r--todolist/todo_test.go (renamed from todo_test.go)0
-rw-r--r--todolist/todos.json1
9 files changed, 32 insertions, 19 deletions
diff --git a/todo.go b/todo.go
index 1319132..0f62340 100644
--- a/todo.go
+++ b/todo.go
@@ -1,22 +1,12 @@
-package todolist
+package main
-import "time"
+import "fmt"
+import "github.com/gammons/todolist/todolist"
-type Todo struct {
- Id int
- Subject string
- Projects []string
- Contexts []string
- Due string
- FormattedDue time.Time
- Completed bool
- Archived bool
-}
-
-func NewTodo() *Todo {
- return &Todo{Completed: false, Archived: false}
-}
-
-func (t Todo) Valid() bool {
- return (t.Subject != "")
+func main() {
+ store := todolist.NewFileStore()
+ store.Load()
+ for _, item := range store.Data {
+ fmt.Println(item)
+ }
}
diff --git a/file_store.go b/todolist/file_store.go
index 3f71ba2..3f71ba2 100644
--- a/file_store.go
+++ b/todolist/file_store.go
diff --git a/file_store_test.go b/todolist/file_store_test.go
index 8bb23e0..8bb23e0 100644
--- a/file_store_test.go
+++ b/todolist/file_store_test.go
diff --git a/parser.go b/todolist/parser.go
index d3b5968..d3b5968 100644
--- a/parser.go
+++ b/todolist/parser.go
diff --git a/parser_test.go b/todolist/parser_test.go
index 1ab2826..1ab2826 100644
--- a/parser_test.go
+++ b/todolist/parser_test.go
diff --git a/store.go b/todolist/store.go
index 006583a..006583a 100644
--- a/store.go
+++ b/todolist/store.go
diff --git a/todolist/todo_item.go b/todolist/todo_item.go
new file mode 100644
index 0000000..1319132
--- /dev/null
+++ b/todolist/todo_item.go
@@ -0,0 +1,22 @@
+package todolist
+
+import "time"
+
+type Todo struct {
+ Id int
+ Subject string
+ Projects []string
+ Contexts []string
+ Due string
+ FormattedDue time.Time
+ Completed bool
+ Archived bool
+}
+
+func NewTodo() *Todo {
+ return &Todo{Completed: false, Archived: false}
+}
+
+func (t Todo) Valid() bool {
+ return (t.Subject != "")
+}
diff --git a/todo_test.go b/todolist/todo_test.go
index aab2a74..aab2a74 100644
--- a/todo_test.go
+++ b/todolist/todo_test.go
diff --git a/todolist/todos.json b/todolist/todos.json
new file mode 100644
index 0000000..dac8b93
--- /dev/null
+++ b/todolist/todos.json
@@ -0,0 +1 @@
+[{"subject":"this is the first subject","projects":[],"contexts":["root"],"due":"2016-04-04","completed":true,"id":1,"archived":true},{"subject":" audit userify for 2FA","projects":[],"contexts":[],"due":null,"completed":null,"id":2,"archived":false}]