todorantapi

package module
v0.0.0-...-03247df Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ApiUrl = "https://backend.todorant.com"
View Source
const RequestMethodDelete = "DELETE"
View Source
const RequestMethodGet = "GET"
View Source
const RequestMethodPost = "POST"
View Source
const RequestMethodPut = "PUT"

Variables

This section is empty.

Functions

This section is empty.

Types

type GetCurrentTodoParams

type GetCurrentTodoParams struct {
	Date string `url:"date"`
}

type GetTodoParams

type GetTodoParams struct {
	Completed    bool   `url:"completed"`
	Hash         string `url:"hash"`
	QueryString  string `url:"queryString"`
	Limit        int    `url:"limit"`
	Skip         int    `url:"skip"`
	Today        string `url:"today"`
	Date         string `url:"date"`
	CalendarView bool   `url:"calendarView"`
	Time         string `url:"time"`
}

type ResponseCurrentTodo

type ResponseCurrentTodo struct {
	TodosCount           int  `json:"todosCount"`
	IncompleteTodosCount int  `json:"incompleteTodosCount"`
	Todo                 Todo `json:"todo"`
}

type ResponseTodos

type ResponseTodos struct {
	Todos  []Todo `json:"todos"`
	Points int    `json:"points"`
}

type ServerError

type ServerError struct {
	ErrorTitle   string `json:"error"`
	ErrorMessage string `json:"message"`
	ErrorCode    int
}

func (*ServerError) Error

func (e *ServerError) Error() string

type Settings

type Settings struct {
	PreserveOrderByTime         bool   `json:"preserveOrderByTime"`
	RemoveCompletedFromCalendar bool   `json:"removeCompletedFromCalendar"`
	UpdatedAt                   string `json:"updatedAt"`
	StartTimeOfDay              string `json:"startTimeOfDay"`
	FirstDayOfWeek              int    `json:"firstDayOfWeek"`
}

type SettingsParams

type SettingsParams struct {
	ShowTodayOnAddTodo bool `json:"showTodayOnAddTodo"`
	FirstDayOfWeek     int  `json:"firstDayOfWeek"`
}

type Todo

type Todo struct {
	Id           string `json:"_id,omitempty"`
	Text         string `json:"text"`
	Completed    bool   `json:"completed"`
	Frog         bool   `json:"frog"`
	FrogFails    int    `json:"frogFails"`
	Skipped      bool   `json:"skipped"`
	Order        int    `json:"order"`
	MonthAndYear string `json:"monthAndYear"`
	Date         string `json:"date"`
	Time         string `json:"time"`
	GoFirst      bool   `json:"goFirst"`
	Today        string `json:"today"`
	Repetitive   bool   `json:"repetitive"`
	Deleted      bool   `json:"deleted"`
	Encrypted    bool   `json:"encrypted"`
	ClientId     string `json:"clientId"`
	User         User   `json:"user"`
	CreatedAt    string `json:"createdAt"`
	UpdatedAt    string `json:"updatedAt"`
}

type Todorant

type Todorant struct {
	Token      string
	HttpClient *http.Client
}
var TodorantGlobal *Todorant

func New

func New(token string) Todorant

func (*Todorant) CreateTodo

func (td *Todorant) CreateTodo(todos []Todo) (string, error)

func (*Todorant) DeleteTodo

func (td *Todorant) DeleteTodo(todoId string) error

func (*Todorant) DoneTodo

func (td *Todorant) DoneTodo(todoId string) error

func (*Todorant) EditTodo

func (td *Todorant) EditTodo(todo *Todo) error

func (*Todorant) GetCurrentTodo

func (td *Todorant) GetCurrentTodo(params GetCurrentTodoParams) (ResponseCurrentTodo, error)

func (*Todorant) GetTodos

func (td *Todorant) GetTodos(params GetTodoParams) (*ResponseTodos, error)

func (*Todorant) GetUserData

func (td *Todorant) GetUserData() (*User, error)

func (*Todorant) Request

func (td *Todorant) Request(requestMethod string, method string, data interface{}, params interface{}) (string, error)

Returns json string

func (*Todorant) SetSettings

func (td *Todorant) SetSettings(settings SettingsParams) (string, error)

func (*Todorant) SkipTodo

func (td *Todorant) SkipTodo(todoId string) error

func (*Todorant) UnDoneTodo

func (td *Todorant) UnDoneTodo(todoId string) error

type User

type User struct {
	Id                 string   `json:"_id"`
	Name               string   `json:"name"`
	Email              string   `json:"email"`
	FacebookId         string   `json:"facebookId"`
	TelegramId         string   `json:"telegramId"`
	AppleSubId         string   `json:"appleSubId"`
	Token              string   `json:"token"`
	Settings           Settings `json:"settings"`
	Timezone           string   `json:"timezone"`
	TelegramZen        bool     `json:"telegramZen"`
	TelegramLanguage   string   `json:"telegramLanguage"`
	SubscriptionStatus string   `json:"subscriptionStatus"`
	SubscriptionId     string   `json:"subscriptionId"`
	AppleReceipt       string   `json:"appleReceipt"`
	GoogleReceipt      string   `json:"googleReceipt"`
	CreatedOnApple     bool     `json:"createdOnApple"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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