Documentation ¶
Index ¶
- func CreateTable(f *os.File, cols []string) *tabwriter.Writer
- func FormatDate(d DueDate, dateFmt string) (string, error)
- func GetFields(val interface{}, cols []string, dateFmt string) []string
- func PrintLabels(f *os.File, labels []Label, cols []string, sortCol string, dateFmt string)
- func PrintProjects(f *os.File, projects []Project, cols []string, sortCol string, dateFmt string)
- func PrintTasks(f *os.File, tasks []Task, cols []string, sortCol string, dateFmt string)
- func SortByField(rows interface{}, column string)
- func Tabulate(cols []string) []interface{}
- type Client
- func (c *Client) AddTask(task Task) ([]Task, error)
- func (c *Client) BuildFilter(required []string, optional []string) string
- func (c *Client) CloseTask(task Task) error
- func (c *Client) Columns(cmdColumns []string, rootColumns []string, configColumns []string) []string
- func (c *Client) Config() *config.Config
- func (c *Client) FindLabel(name string) (Label, error)
- func (c *Client) FindProject(name string) (Project, error)
- func (c *Client) Get(parts ...string) (body []byte, status int, err error)
- func (c *Client) GetLabels() ([]Label, error)
- func (c *Client) GetProjects() ([]Project, error)
- func (c *Client) GetTasks(project string, required []string, optional []string) ([]Task, error)
- func (c *Client) Request() *resty.Request
- func (c *Client) Resolve(parts ...string) string
- func (c *Client) Sort(cmdSort string, rootSort string, configSort string) string
- type DueDate
- type Label
- type Project
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTable ¶
CreateTable with column headers and return a row writer
func PrintLabels ¶
PrintLabels after sorting, with column headers
func PrintProjects ¶
PrintProjects after sorting, with column headers
func PrintTasks ¶
PrintTasks in a table
func SortByField ¶
func SortByField(rows interface{}, column string)
SortByField sorts the given slice of rows by the selected column
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for API
func (*Client) BuildFilter ¶
func (*Client) Columns ¶
func (c *Client) Columns(cmdColumns []string, rootColumns []string, configColumns []string) []string
Columns to display based on command, config, and flags
func (*Client) FindProject ¶
FindProject by name
func (*Client) Request ¶
func (c *Client) Request() *resty.Request
Request an API endpoint with authorization
type Label ¶
type Label struct { ID int `json:"id" yaml:"id"` Name string `json:"name" yaml:"name"` Order int `json:"order" yaml:"order"` }
Label model https://developer.todoist.com/rest/v8/#labels
type Project ¶
type Project struct { ID int `json:"id" yaml:"id"` Indent int `json:"indent" yaml:"indent"` Name string `json:"name" yaml:"name"` Order int `json:"order" yaml:"order"` }
Project model https://developer.todoist.com/rest/v8/#projects
func ParseProjects ¶
ParseProjects from byte array
type Task ¶
type Task struct { Content string `json:"content" yaml:"content"` Due DueDate `json:"due" yaml:"due"` ID int `json:"id" yaml:"id,omitempty"` Labels []int `json:"label_ids" yaml:"label_ids"` Order int `json:"order" yaml:"order,omitempty"` Priority int `json:"priority" yaml:"priority,omitempty"` Project int `json:"project_id" yaml:"project_id"` }
Task model https://developer.todoist.com/rest/v8/#tasks
Click to show internal directories.
Click to hide internal directories.