Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Token string
Token save the personal token from todoist
Functions ¶
This section is empty.
Types ¶
type CustomTime ¶
CustomTime had a custom json date format
func (CustomTime) MarshalJSON ¶
func (ct CustomTime) MarshalJSON() ([]byte, error)
MarshalJSON convert CustomTime to []byte
func (*CustomTime) UnmarshalJSON ¶
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON convert from []byte to CustomTime
type Due ¶
type Due struct {
String string `json:"string"`
Date string `json:"date"`
Datetime CustomTime `json:"datetime"`
Timezone string `json:"timezone"`
}
Due is a model of todoist project entity
type Project ¶
type Project struct {
ID int `json:"id"`
Name string `json:"name"`
CommentCount int `json:"comment_count"`
Order int `json:"order"`
Indent int `json:"indent"`
}
Project is a model of todoist project entity
func CreateProject ¶
CreateProject create a new project with a name
Example:
todoist.Token = "your token"
project, err := todoist.CreateProject("New Project")
if err != nil {
panic(err)
}
fmt.Println(project)
func GetProject ¶
GetProject return a project by id
Example:
todoist.Token = "your token"
project, err := todoist.GetProject(1)
if err != nil {
panic(err)
}
fmt.Println(project)
func ListProject ¶
ListProject return all projects
Example:
todoist.Token = "your token"
projects, err := todoist.ListProject()
if err != nil {
panic(err)
}
fmt.Println(projects)
type QueryParam ¶
QueryParam is a map[string]string to build http query
func (QueryParam) String ¶
func (qp QueryParam) String() string
type Task ¶
type Task struct {
ID int `json:"id"`
CommentCount int `json:"comment_count"`
Completed bool `json:"completed"`
Content string `json:"content"`
Indent int `json:"indent"`
LabelIDs []int `json:"label_ids"`
Order int `json:"order"`
Priority int `json:"priority"`
ProjectID int `json:"project_id"`
Due Due `json:"due"`
}
Task is a model of todoist project entity
func ListTask ¶
func ListTask(qp QueryParam) ([]Task, error)
ListTask return all task, you can filter using QueryParam See documentation: https://developer.todoist.com/rest/v8/#get-tasks
Click to show internal directories.
Click to hide internal directories.