process

package
v0.0.0-...-0202b1c Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidReqs = errors.New("could not make sense of requirements")
	ErrListProcess = errors.New("could not fetch task list")
)
View Source
var (
	ErrCouldNotFetchProjects = errors.New("could not fetch projects")
)
View Source
var (
	ErrFetchProcess = errors.New("could not fetch tasks")
)
View Source
var (
	ErrInboxProcess = errors.New("could not process inbox")
)
View Source
var (
	ErrNewTask = errors.New("could not add new task")
)
View Source
var (
	ErrRecurProcess = errors.New("could not generate tasks from recurrer")
)
View Source
var (
	ErrSendTasks = errors.New("could not send tasks")
)
View Source
var (
	ErrUpdateTask = errors.New("could not update tsk")
)

Functions

This section is empty.

Types

type Fetch

type Fetch struct {
	// contains filtered or unexported fields
}

Fetch fetches all tasks in regular folders from the remote repository and overwrites what is stored locally

func NewFetch

func NewFetch(remote *storage.RemoteRepository, local storage.LocalRepository, folders ...string) *Fetch

func (*Fetch) Process

func (s *Fetch) Process() (*FetchResult, error)

type FetchResult

type FetchResult struct {
	Duration string `json:"duration"`
	Count    int    `json:"count"`
}

type Inbox

type Inbox struct {
	// contains filtered or unexported fields
}

Inbox processes all messages in INBOX in a remote repository

func NewInbox

func NewInbox(repo *storage.RemoteRepository) *Inbox

func (*Inbox) Process

func (inbox *Inbox) Process() (*InboxResult, error)

type InboxResult

type InboxResult struct {
	Duration string `json:"duration"`
	Count    int    `json:"count"`
}

type List

type List struct {
	// contains filtered or unexported fields
}

List finds all tasks that satisfy the given requirements

func NewList

func NewList(local storage.LocalRepository, reqs ListReqs) *List

func (*List) Process

func (l *List) Process() (*ListResult, error)

type ListReqs

type ListReqs struct {
	Due           task.Date
	IncludeBefore bool
	Folder        string
	Project       string
	ApplyUpdates  bool
}

ListReqs specifies the requirements in AND fashion for a list of tasks

func (ListReqs) Valid

func (lr ListReqs) Valid() bool

type ListResult

type ListResult struct {
	Tasks []*task.LocalTask
}

type New

type New struct {
	// contains filtered or unexported fields
}

func NewNew

func NewNew(local storage.LocalRepository, update *task.LocalUpdate) *New

func (*New) Process

func (n *New) Process() error

type Projects

type Projects struct {
	// contains filtered or unexported fields
}

func NewProjects

func NewProjects(local storage.LocalRepository) *Projects

func (*Projects) Process

func (p *Projects) Process() ([]string, error)

type Recur

type Recur struct {
	// contains filtered or unexported fields
}

Recur generates new tasks from a recurring task for a given day

func NewRecur

func NewRecur(repo *storage.RemoteRepository, disp *storage.Dispatcher, daysAhead int) *Recur

func (*Recur) Process

func (recur *Recur) Process() (*RecurResult, error)

type RecurResult

type RecurResult struct {
	Duration string `json:"duration"`
	Count    int    `json:"count"`
}

type Send

type Send struct {
	// contains filtered or unexported fields
}

Send sends local tasks that need to be dispatched

func NewSend

func NewSend(local storage.LocalRepository, disp *storage.Dispatcher) *Send

func (*Send) Process

func (s *Send) Process() (int, error)

type Update

type Update struct {
	// contains filtered or unexported fields
}

Update updates a local task

func NewUpdate

func NewUpdate(local storage.LocalRepository, taskId string, update *task.LocalUpdate) *Update

func (*Update) Process

func (u *Update) Process() error

Jump to

Keyboard shortcuts

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