todoist

package
v0.0.0-...-347e25e Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a http client for Todoist API

func NewClient

func NewClient(client *http.Client, devBaseURL, authzBaseURL string) *Client

NewClient is a constructor for Client

func (*Client) GetTasks

func (c *Client) GetTasks(ctx context.Context, token string) ([]*Task, error)

GetTasks returns user's tasks

func (*Client) RetrieveAccessToken

func (c *Client) RetrieveAccessToken(ctx context.Context, clientID, clientSecret, code, redirectURL string) (string, error)

RetrieveAccessToken returns user's access token

type Due

type Due struct {
	Date        string    `json:"date"`
	IsRecurring bool      `json:"is_recurring"`
	Datetime    time.Time `json:"datetime"`
	String      string    `json:"string"`
	Timezone    string    `json:"timezone"`
}

Due represents schedule configuration

type Duration

type Duration struct {
	Amount int    `json:"amount"`
	Unit   string `json:"unit"`
}

Duration of how much time dedicated to a task

type Task

type Task struct {
	CreatorID    string    `json:"creator_id"`
	CreatedAt    time.Time `json:"created_at"`
	AssigneeID   string    `json:"assignee_id"`
	AssignerID   string    `json:"assigner_id"`
	CommentCount int       `json:"comment_count"`
	IsCompleted  bool      `json:"is_completed"`
	Content      string    `json:"content"`
	Description  string    `json:"description"`
	Due          *Due      `json:"due"`
	Duration     *Duration `json:"duration"`
	ID           string    `json:"id"`
	Labels       []string  `json:"labels"`
	Order        int       `json:"order"`
	Priority     int       `json:"priority"`
	ProjectID    string    `json:"project_id"`
	SectionID    string    `json:"section_id"`
	ParentID     string    `json:"parent_id"`
	URL          string    `json:"url"`
}

Task is a representation in Todoist

Jump to

Keyboard shortcuts

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