todoist

package module
v0.0.0-...-bb87462 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 16 Imported by: 0

README

Todoist Terminal Client

A small Todoist client on terminal written in Go. screencast

How to use

# build the client yourself
$ go get github.com/haccht/todoist
$ cd $GOPATH/github.com/haccht/todoist/cmd/todoist
$ go build

# and then execute
$ ./todoist

You'll be required the Todoist API token for the first run.
Enjoy!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication() (*Application, error)

func (*Application) Complete

func (a *Application) Complete()

func (*Application) Delete

func (a *Application) Delete()

func (*Application) EditContent

func (a *Application) EditContent()

func (*Application) EditDuedate

func (a *Application) EditDuedate()

func (*Application) GetSelection

func (a *Application) GetSelection() (int, *Task)

func (*Application) MoveProject

func (a *Application) MoveProject()

func (*Application) QuickAdd

func (a *Application) QuickAdd()

func (*Application) QuickFilter

func (a *Application) QuickFilter()

func (*Application) Refresh

func (a *Application) Refresh() error

func (*Application) Reopen

func (a *Application) Reopen()

func (*Application) Run

func (a *Application) Run() error

func (*Application) SetFilter

func (a *Application) SetFilter(str string) error

func (*Application) SetPriority

func (a *Application) SetPriority(p int)

func (*Application) ShowDetail

func (a *Application) ShowDetail()

func (*Application) ShowHelp

func (a *Application) ShowHelp()

func (*Application) Stop

func (a *Application) Stop()

func (*Application) Update

func (a *Application) Update() error

type Client

type Client struct {
	Logger     *log.Logger
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(authToken string) *Client

func (*Client) AddTask

func (c *Client) AddTask(args *map[string]interface{}) (*Task, error)

func (*Client) CloseTask

func (c *Client) CloseTask(id uint) error

func (*Client) DeleteTask

func (c *Client) DeleteTask(id uint) error

func (*Client) GetTask

func (c *Client) GetTask(id uint) (*Task, error)

func (*Client) ListComments

func (c *Client) ListComments(args *map[string]interface{}) ([]*Comment, error)

func (*Client) ListLabels

func (c *Client) ListLabels() ([]*Label, error)

func (*Client) ListProjects

func (c *Client) ListProjects() ([]*Project, error)

func (*Client) ListTasks

func (c *Client) ListTasks(filter *map[string]interface{}) ([]*Task, error)

func (*Client) MoveTask

func (c *Client) MoveTask(id uint, args *map[string]interface{}) error

func (*Client) QuickAddTask

func (c *Client) QuickAddTask(text string, args *map[string]interface{}) error

func (*Client) ReopenTask

func (c *Client) ReopenTask(id uint) error

func (*Client) UpdateTask

func (c *Client) UpdateTask(id uint, args *map[string]interface{}) error

type Comment

type Comment struct {
	ID        uint   `json:"id"`
	Posted    string `json:"posted"`
	CommentID uint   `json:"comment_id"`
	ProjectID uint   `json:"project_id"`
	Content   string `json:"content"`
}

type Config

type Config struct {
	Token  string `json:"token"`
	Filter string `json:"filter,omitempty"`
	Closed uint   `json:"closed,omitempty"`
}

func NewConfig

func NewConfig() (*Config, error)

func (*Config) Save

func (c *Config) Save()

type Label

type Label struct {
	ID    uint   `json:"id"`
	Name  string `json:"name"`
	Order uint   `json:"order"`
}

type Project

type Project struct {
	ID           uint   `json:"id"`
	Name         string `json:"name"`
	Order        uint   `json:"order"`
	Indent       uint   `json:"indent"`
	CommentCount uint   `json:"comment_count"`
}

type RequestOption

type RequestOption struct {
	Params  map[string]string
	Headers map[string]string
	Body    io.Reader
}

func NewRequestOption

func NewRequestOption() *RequestOption

type Task

type Task struct {
	ID           uint   `json:"id"`
	Content      string `json:"content"`
	ProjectID    uint   `json:"project_id"`
	LabelIDs     []uint `json:"label_ids"`
	Priority     uint   `json:"priority"`
	Completed    bool   `json:"completed"`
	CommentCount uint   `json:"comment_count"`
	Order        uint   `json:"order"`
	Indent       uint   `json:"indent"`
	URL          string `json:"url"`
	Due          struct {
		Date      string `json:"date,omitempty"`
		Datetime  string `json:"datetime,omitempty"`
		Recurring bool   `json:"recurring,omitempty"`
		String    string `json:"string,omitempty"`
		Timezone  string `json:"timezone,omitempty"`
	} `json:"due"`
}

func (*Task) DueString

func (t *Task) DueString() string

func (*Task) DueTime

func (t *Task) DueTime() time.Time

func (*Task) IsDuedate

func (t *Task) IsDuedate() bool

func (*Task) IsOverdue

func (t *Task) IsOverdue() bool

type UI

type UI struct {
	*tview.Application
	// contains filtered or unexported fields
}

func NewUI

func NewUI() *UI

func (*UI) ErrorMessage

func (u *UI) ErrorMessage(err error)

func (*UI) FilterStatus

func (u *UI) FilterStatus(filter string)

func (*UI) GetSelection

func (u *UI) GetSelection() int

func (*UI) Init

func (u *UI) Init()

func (*UI) Popup

func (u *UI) Popup(title, content string)

func (*UI) PopupConfirm

func (u *UI) PopupConfirm(message string, buttonLabels []string, callbackFunc func(string))

func (*UI) PopupInput

func (u *UI) PopupInput(title, text string, callbackFunc func(string))

func (*UI) RemoveRow

func (u *UI) RemoveRow(r int)

func (*UI) RenderRow

func (u *UI) RenderRow(r int, cells ...*tview.TableCell)

func (*UI) Run

func (u *UI) Run() error

func (*UI) SetInputCapture

func (u *UI) SetInputCapture(f func(*tcell.EventKey) *tcell.EventKey)

func (*UI) StatusLine

func (u *UI) StatusLine(message string, duration time.Duration)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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