Documentation
¶
Index ¶
- Variables
- func ExportToGoogle(tasks []Task) error
- func InitializeGoogleTasks() error
- func NewModel(tasks []Task, client *GoogleTasksClient) model
- func RunTaskUI(tasks []Task, client *GoogleTasksClient)
- func SaveGoogleTasks(tasks []Task) error
- func SaveTasks(tasks []Task) error
- func SaveToLocal(tasks []Task) error
- func SetCurrentModel(m *model)
- func SetGlobalConfig(config *GodoConfig)
- type GodoConfig
- type GoogleTasksCache
- type GoogleTasksClient
- type Task
Constants ¶
This section is empty.
Variables ¶
var ( UseGoogleTasks bool GoogleTasksClientVar *GoogleTasksClient )
Functions ¶
func ExportToGoogle ¶
func InitializeGoogleTasks ¶
func InitializeGoogleTasks() error
InitializeGoogleTasks sets up the Google Tasks API client and cache
func NewModel ¶
func NewModel(tasks []Task, client *GoogleTasksClient) model
NewModel initializes the Bubble Tea model with tasks
func RunTaskUI ¶
func RunTaskUI(tasks []Task, client *GoogleTasksClient)
RunTaskUI starts the Bubble Tea program
func SaveGoogleTasks ¶
func SaveToLocal ¶
func SetCurrentModel ¶
func SetCurrentModel(m *model)
func SetGlobalConfig ¶
func SetGlobalConfig(config *GodoConfig)
Types ¶
type GodoConfig ¶
type GodoConfig struct {
StoragePath string `config:"StoragePath"`
GoogleClientID string `config:"GoogleClientID"`
GoogleClientSecret string `config:"GoogleClientSecret"`
GoogleTokenPath string `config:"GoogleTokenPath"`
}
GodoConfig struct with field names that match the config keys
func GetGlobalConfig ¶
func GetGlobalConfig() *GodoConfig
func LoadConfig ¶
func LoadConfig(configPath string) (GodoConfig, error)
LoadConfig reads or creates the config file, adds missing fields, and returns the populated CurdConfig struct
type GoogleTasksCache ¶
type GoogleTasksCache struct {
Tasks []Task
LastSync time.Time
// contains filtered or unexported fields
}
GoogleTasksCache holds the cached tasks and handles background updates
type GoogleTasksClient ¶
type GoogleTasksClient struct {
// contains filtered or unexported fields
}
GoogleTasksClient wraps Google Tasks service
func NewGoogleTasksClient ¶
func NewGoogleTasksClient(service *v1.Service) *GoogleTasksClient
NewGoogleTasksClient returns a new GoogleTasksClient instance
func (*GoogleTasksClient) CreateTask ¶
func (c *GoogleTasksClient) CreateTask(task Task, listID string) (Task, error)
CreateTask creates a new task in the specified task list
func (*GoogleTasksClient) DeleteTask ¶
func (c *GoogleTasksClient) DeleteTask(taskID string) error
DeleteTask deletes a task from the first task list
func (*GoogleTasksClient) LoadTasks ¶
func (c *GoogleTasksClient) LoadTasks() ([]Task, error)
LoadTasks retrieves tasks from the first task list
func (*GoogleTasksClient) UpdateTask ¶
func (c *GoogleTasksClient) UpdateTask(task Task) error
UpdateTask updates an existing task in the first task list
type Task ¶
type Task struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Notes string `json:"notes"`
Status string `json:"status"`
Completed bool `json:"completed"`
CreatedAt time.Time `json:"createdAt"`
DueDate time.Time `json:"dueDate"`
CompletedDate time.Time `json:"completedDate"`
Parent string `json:"parent"`
Position string `json:"position"`
Kind string `json:"kind"`
SelfLink string `json:"selfLink"`
Etag string `json:"etag"`
Updated time.Time `json:"updated"`
Created time.Time `json:"created"`
Deleted bool `json:"deleted"`
Tasks []Task `json:"tasks"`
Links []struct {
Type string `json:"type"`
Desc string `json:"description"`
Link string `json:"link"`
} `json:"links"`
}
Task represents a task or subtask