todos

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(title, desc string, id int)

Add creates new Todo

func FormatAndPrint

func FormatAndPrint(t Todo)

FormatAndPrint a Todo item to the console

func ImportList

func ImportList(term string, client Provider) map[string]Todo

ImportList returns title -> Todo map for provider issues list

func List

func List() map[string]Todo

List all todos

func Mark

func Mark(todo Todo)

Mark a single todo

func Remove

func Remove(t Todo)

Remove an existing Todo

Types

type GitHubIssue

type GitHubIssue struct {
	Title string `json:"title"`
	Body  string `json:"body"`
	ID    int    `json:"number"`
}

GitHubIssue type

type GitHubProvider

type GitHubProvider struct {
	URL string
}

GitHubProvider for importing issues from GitHub -----------------------------------------------

func (GitHubProvider) Name

func (gh GitHubProvider) Name() string

Name returns a friendly GitHub name

func (GitHubProvider) Search

func (gh GitHubProvider) Search(term string) []Todo

Search for issues on GitHub

type GitHubResponse

type GitHubResponse struct {
	Total int           `json:"total_count"`
	Items []GitHubIssue `json:"items"`
}

GitHubResponse type

type Provider

type Provider interface {
	// Name returns a friendly <Provider> name
	Name() string
	// Search for issues on <Provider>
	Search(term string) []Todo
}

Provider interface ------------------

type Todo

type Todo struct {
	Title       string
	Description string
	Marked      bool
	ID          int
}

Todo represents a single Todo

func GetMarkedOrSelected

func GetMarkedOrSelected(marked bool) (Todo, error)

GetMarkedOrSelected todo item

func Select

func Select(todosMap map[string]Todo) (Todo, error)

Select asks the user to select a single Todo from all avaiable Todos and returns it.

type TodoCollection

type TodoCollection struct {
	Todos []Todo
}

TodoCollection represents an array of Todos

Jump to

Keyboard shortcuts

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