app

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseQuickAdd

func ParseQuickAdd(raw string) (domain.CreateTaskInput, error)

func ResolveHabit

func ResolveHabit(ref string, habits []domain.Habit) (domain.Habit, error)

func ResolveProject

func ResolveProject(ref string, projects []domain.Project) (domain.Project, error)

Types

type AuthApp

type AuthApp struct {
	ConfigStore      *config.Store
	Service          AuthService
	ServiceForRegion AuthServiceFactory
}

func (AuthApp) Login

func (a AuthApp) Login(ctx context.Context, in LoginInput) error

func (AuthApp) Logout

func (a AuthApp) Logout(ctx context.Context) error

func (AuthApp) Status

func (a AuthApp) Status(ctx context.Context) (auth.Status, error)

type AuthService

type AuthService interface {
	Login(context.Context, auth.LoginInput) (auth.Token, error)
	Status(context.Context) (auth.Status, error)
	Logout(context.Context) error
}

type AuthServiceFactory

type AuthServiceFactory func(region string) (AuthService, error)

type ConfigApp

type ConfigApp struct {
	Store *config.Store
}

func (ConfigApp) Get

func (a ConfigApp) Get(ctx context.Context, key string) (string, error)

func (ConfigApp) List

func (a ConfigApp) List(ctx context.Context) (string, error)

func (ConfigApp) Set

func (a ConfigApp) Set(ctx context.Context, key, value string) error

type FocusAPI

type FocusAPI interface {
	GetFocus(context.Context, string, string, int) (domain.Focus, error)
	ListFocus(context.Context, string, time.Time, time.Time, int) ([]domain.Focus, error)
	ListProjects(context.Context, string) ([]domain.Project, error)
}

type FocusApp

type FocusApp struct {
	Auth   ProjectTokenSource
	Client FocusAPI
	Now    func() time.Time
}

func (FocusApp) Get

func (a FocusApp) Get(ctx context.Context, focusID string, focusType int) (domain.Focus, error)

func (FocusApp) List

func (a FocusApp) List(ctx context.Context, in ListFocusInput) ([]domain.Focus, map[string]string, error)

func (FocusApp) ListProjects

func (a FocusApp) ListProjects(ctx context.Context) ([]domain.Project, error)

type HabitApp

type HabitApp struct {
	Auth   ProjectTokenSource
	Client HabitAPI
}

func (HabitApp) Add

func (HabitApp) Archive

func (a HabitApp) Archive(ctx context.Context, ref string) (domain.Habit, error)

func (HabitApp) Checkin

func (a HabitApp) Checkin(ctx context.Context, ref string, value float64) error

func (HabitApp) Get

func (a HabitApp) Get(ctx context.Context, ref string) (domain.Habit, error)

func (HabitApp) List

func (a HabitApp) List(ctx context.Context) ([]domain.Habit, error)

func (HabitApp) Log

func (a HabitApp) Log(ctx context.Context, ref string) ([]domain.HabitCheckin, error)

func (HabitApp) Update

type ListFocusInput

type ListFocusInput struct {
	From string
	To   string
	Type int
}

type ListTasksInput

type ListTasksInput struct {
	Project    string
	Tags       []string
	Statuses   []domain.TaskStatus
	Priorities []domain.Priority
	From       string
	To         string
	Today      bool
	Overdue    bool
}

type LoginInput

type LoginInput struct {
	ClientID     string
	ClientSecret string
	RedirectURL  string
	Region       string
}

type ProjectAPI

type ProjectAPI interface {
	ListProjects(context.Context, string) ([]domain.Project, error)
	CreateProject(context.Context, string, string, string) (domain.Project, error)
	UpdateProject(context.Context, string, string, string, string) (domain.Project, error)
	DeleteProject(context.Context, string, string) error
}

type ProjectApp

type ProjectApp struct {
	Auth   ProjectTokenSource
	Client ProjectAPI
}

func (ProjectApp) Create

func (a ProjectApp) Create(ctx context.Context, name, kind string) (domain.Project, error)

func (ProjectApp) Get

func (a ProjectApp) Get(ctx context.Context, ref string) (domain.Project, error)

func (ProjectApp) List

func (a ProjectApp) List(ctx context.Context) ([]domain.Project, error)

func (ProjectApp) Remove

func (a ProjectApp) Remove(ctx context.Context, ref string) error

func (ProjectApp) Update

func (a ProjectApp) Update(ctx context.Context, ref, name, kind string) (domain.Project, error)

type ProjectTokenSource

type ProjectTokenSource interface {
	AccessToken(context.Context) (string, error)
}

type QuickAddApp

type QuickAddApp struct {
	TaskApp     *TaskApp
	ConfigStore *config.Store
}

func (QuickAddApp) Add

func (a QuickAddApp) Add(ctx context.Context, raw string) (domain.Task, error)

type TaskApp

type TaskApp struct {
	Auth        ProjectTokenSource
	Client      TaskAPI
	ConfigStore *config.Store
	Now         func() time.Time
}

func (TaskApp) Add

func (TaskApp) Done

func (a TaskApp) Done(ctx context.Context, ref string, projectRef string) error

func (TaskApp) Get

func (a TaskApp) Get(ctx context.Context, ref string, projectRef string) (domain.Task, map[string]string, error)

func (TaskApp) List

func (a TaskApp) List(ctx context.Context, in ListTasksInput) ([]domain.Task, map[string]string, error)

func (TaskApp) ListProjects

func (a TaskApp) ListProjects(ctx context.Context) ([]domain.Project, error)

func (TaskApp) Move

func (a TaskApp) Move(ctx context.Context, in domain.MoveTaskInput) error

func (TaskApp) Remove

func (a TaskApp) Remove(ctx context.Context, ref string, projectRef string) error

func (TaskApp) Reopen

func (a TaskApp) Reopen(ctx context.Context, ref string, projectRef string) error

func (TaskApp) Today

func (a TaskApp) Today(ctx context.Context) ([]domain.Task, map[string]string, error)

func (TaskApp) Update

Jump to

Keyboard shortcuts

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