rtm

package
v0.0.0-...-d7f7d33 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package rtm provides a client functionality for Remember the Milk api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Token string
	Perms string
	User  User
}

type AuthService

type AuthService struct {
	HTTP *HTTP
}

func (*AuthService) GetFrob

func (s *AuthService) GetFrob() (string, error)

func (*AuthService) GetToken

func (s *AuthService) GetToken(frob string) (Auth, error)

type Chunk

type Chunk struct {
	ID         string
	Due        string
	HasDueTime string `json:"has_due_time"`
	Added      string
	Completed  string
	Deleted    string
	Priority   string
	Postponed  string
	Estimate   string
}

type Client

type Client struct {
	HTTP         *HTTP
	Auth         AuthService
	Timelines    TimelinesService
	Lists        ListsService
	Tasks        TasksService
	Transactions TransactionsService
}

func NewClient

func NewClient(token string, apiKey string) *Client

func (*Client) GetAuthURL

func (r *Client) GetAuthURL(frob string, perms []string) string

func (*Client) SetBaseURL

func (r *Client) SetBaseURL(url string)

type ErrorResponse

type ErrorResponse struct {
	Msg  string
	Code string
}

func (*ErrorResponse) Error

func (err *ErrorResponse) Error() string

type GetTokenResult

type GetTokenResult struct {
	Rsp getTokenResultContent
}

type HTTP

type HTTP struct {
	Token   string
	ApiKey  string
	BaseURL string
}

func (*HTTP) GetAuthURL

func (c *HTTP) GetAuthURL(frob string, perms []string) string

func (*HTTP) Request

func (c *HTTP) Request(method string, params map[string]string, result interface{}) error

func (*HTTP) VerifyResponse

func (c *HTTP) VerifyResponse(err error, stat string, resp ErrorResponse) error

type List

type List struct {
	ID        string
	Name      string
	Deleted   string
	Locked    string
	Archived  string
	Position  string
	Smart     string
	SortOrder string `json:"sort_order"`
}

type Lists

type Lists struct {
	Lists []List `json:"list"`
}

type ListsService

type ListsService struct {
	HTTP *HTTP
}

func (*ListsService) Add

func (s *ListsService) Add(name string, timeline string) (List, Transaction, error)

func (*ListsService) Delete

func (s *ListsService) Delete(list List, timeline string) (List, Transaction, error)

func (*ListsService) GetList

func (s *ListsService) GetList() ([]List, error)

type Task

type Task struct {
	ID           string
	Created      string
	Modified     string
	Name         string
	Source       string
	URL          string
	LocationID   string `json:"location_id"`
	Tags         interface{}
	Participants []string
	Notes        []string
	Chunks       []Chunk `json:"task"`
	ListID       string  // This field is not included in the API response, and should be manually set.
}

type TasksService

type TasksService struct {
	HTTP *HTTP
}

func (*TasksService) Add

func (s *TasksService) Add(timeline string, name string) ([]Task, *Transaction, error)

func (*TasksService) AddTags

func (s *TasksService) AddTags(task Task, timeline string, tags string) ([]Transaction, error)

func (*TasksService) Complete

func (s *TasksService) Complete(task Task, timeline string) ([]Transaction, error)

func (*TasksService) Delete

func (s *TasksService) Delete(task Task, timeline string) ([]Transaction, error)

func (*TasksService) GetList

func (s *TasksService) GetList(listID string, filter string, lastSync string) ([]Task, error)

func (*TasksService) SetDueDate

func (s *TasksService) SetDueDate(task Task, timeline string, due string) ([]Transaction, error)

func (*TasksService) Uncomplete

func (s *TasksService) Uncomplete(task Task, timeline string) ([]Transaction, error)

type TimelinesService

type TimelinesService struct {
	HTTP *HTTP
}

func (*TimelinesService) Create

func (s *TimelinesService) Create() (string, error)

type Transaction

type Transaction struct {
	ID       string
	Undoable string
}

type TransactionsService

type TransactionsService struct {
	HTTP *HTTP
}

func (*TransactionsService) Undo

func (s *TransactionsService) Undo(timeline string, transaction Transaction) error

type User

type User struct {
	ID       string
	Username string
	Fullname string
}

Jump to

Keyboard shortcuts

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