toodlego

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

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

Go to latest
Published: Jun 10, 2015 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const BASE_URL = "https://api.toodledo.com/3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Alias            string `json:"alias"`
	DateFormat       int    `json:"dateformat"`
	Email            string `json:"email"`
	HideMonths       int    `json:"hidemonths"`
	HotListduedate   int    `json:"hotlistduedate"`
	HotListpriority  int    `json:"hotlistpriority"`
	HotListstar      int    `json:"hotliststar"`
	HotListstatus    int    `json:"hotliststatus"`
	LastDeleteNote   int    `json:"lastdelete_note"`
	LastDeleteTask   int    `json:"lastdelete_task"`
	LastEditContext  int    `json:"lastedit_context"`
	LastEditFolder   int    `json:"lastedit_folder"`
	LastEditGoal     int    `json:"lastedit_goal"`
	LastEditList     int    `json:"lastedit_list"`
	LastEditLocation int    `json:"lastedit_location"`
	LastEditNote     int    `json:"lastedit_note"`
	LastEditOutline  int    `json:"lastedit_outline"`
	LastEditTask     int    `json:"lastedit_task"`
	Pro              int    `json:"pro"`
	ShowTabNums      int    `json:"showtabnums"`
	Timezone         int    `json:"timezone"`
	Userid           string `json:"userid"`
}

type RefreshResponse

type RefreshResponse struct {
	AccessToken  string  `json:"access_token"`
	ExpiresIn    float64 `json:"expires_in"`
	RefreshToken string  `json:"refresh_token"`
	Scope        string  `json:"scope"`
	TokenType    string  `json:"token_type"`
}

type Task

type Task struct {
	Completed int64  `json:"completed"`
	Folder    int64  `json:"folder"`
	ID        int64  `json:"id"`
	Modified  int64  `json:"modified"`
	Priority  int    `json:"priority"`
	Star      int    `json:"star"`
	Title     string `json:"title"`

	// Date and time are ToodleTimes and should not be used directly
	// Use Due() and Start() instead
	DueDate   ToodleTime `json:"duedate"`
	DueTime   ToodleTime `json:"duetime"`
	StartDate ToodleTime `json:"startdate"`
	StartTime ToodleTime `json:"starttime"`

	Length     int64  `json:"length"`
	TagsString string `json:"tag"`
	Parent     int64  `json:"parent"`
}

func (Task) Due

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

func (Task) ImplicitStart

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

ImplicitStart finds the start time for the task implied by the combination of the due time and the length of the task If either the length or the due time is not specified, ImplicitStart defaults to the explicit start time specified

func (Task) IsChild

func (t Task) IsChild() bool

IsChild is a convenience function that returns true if the task has a parent task

func (Task) Start

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

type TaskResponse

type TaskResponse struct {
	Meta  TaskResponseMeta
	Tasks []Task
}

type TaskResponseMeta

type TaskResponseMeta struct {
	Num   int64 `json:"num"`
	Total int64 `json:"total"`
}

type ToodleClient

type ToodleClient struct {
	AppId        string
	ClientSecret string
	AccessToken  string
	RefreshToken string
}

func LoadConfig

func LoadConfig() (*ToodleClient, error)

func (*ToodleClient) AccountInfo

func (c *ToodleClient) AccountInfo() (*Account, error)

func (*ToodleClient) RefreshCredentials

func (c *ToodleClient) RefreshCredentials() (*RefreshResponse, error)

func (*ToodleClient) SaveConfig

func (c *ToodleClient) SaveConfig() error

func (*ToodleClient) Tasks

func (c *ToodleClient) Tasks(modifiedBefore *time.Time, modifiedAfter *time.Time, completed ToodleCompleted, id int64, start int, fields ...string) (*TaskResponse, error)

type ToodleCompleted

type ToodleCompleted int
const (
	CompletedOrNot ToodleCompleted = iota
	Uncompleted
	Completed
)

type ToodleTime

type ToodleTime int64

Jump to

Keyboard shortcuts

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