usecases

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	HideReminder:    false,
	HideRemindTime:  false,
	HidePriority:    false,
	HideGroup:       false,
	TaskFilePath:    filepath.Join(findDataDir(), "todo.json"),
	SlackWebhookURL: "",
	SlackMentionTo:  "",
	ColumnWidth:     30,
}

DefaultConfig is a default config.

Functions

func Add

func Add(r AddRequest) error

Add is a function that add a task (and reminder).

func Close

func Close(ids []int) error

Close is a function that close a task or tasks.

func GetTaskFilePath added in v0.4.0

func GetTaskFilePath() string

GetTaskFilePath is a getter config.TaskFilePath.

func List

func List(group string) error

List is a function that show task list.

func Modify

func Modify(r ModifyRequest) error

Modify is a function that modify a task.

func Notify

func Notify(uuid string) error

Notify is a function that notify a task. It should be called internal only.

func SetConfig added in v0.4.0

func SetConfig(c Config)

SetConfig is a setter to config.

func SetRepository added in v0.4.0

func SetRepository(tr task.Repository)

SetRepository is a setter of repository.

func ValidateTaskFilePath added in v0.4.0

func ValidateTaskFilePath(path string) error

ValidateTaskFilePath judges that a given path is valid for TaskFilePath.

Types

type AddRequest

type AddRequest struct {
	Task           string
	Group          string
	RemindTime     task.RemindTime
	IsRemindTime   bool
	RelativeTime   task.RelativeTime
	IsRelativeTime bool
	Reminder       task.Reminder
	IsReminder     bool
	Priority       int
}

AddRequest is a request parameter to invoke Add.

type Config added in v0.4.0

type Config struct {
	HideReminder    bool
	HideRemindTime  bool
	HidePriority    bool
	HideGroup       bool
	TaskFilePath    string
	SlackWebhookURL string
	SlackMentionTo  string
	ColumnWidth     int
}

Config is an application configuration.

type ConfigFile added in v0.4.0

type ConfigFile struct {
	ConfigName string
	ConfigType string
	ConfigPath string
}

ConfigFile is information of config file location.

func FindConfigFile added in v0.4.0

func FindConfigFile() ConfigFile

FindConfigFile return ConfigFile in which ConfigPath is set according to XDG_DATA_HOME.

type ModifyRequest

type ModifyRequest struct {
	ID               int
	Task             string
	IsTask           bool
	Group            string
	IsGroup          bool
	RemindTime       task.RemindTime
	IsRemindTime     bool
	RelativeTime     task.RelativeTime
	IsRelativeTime   bool
	IsRemoveReminder bool
	Reminder         task.Reminder
	IsReminder       bool
	Priority         int
	IsPriority       bool
}

ModifyRequest is a request parameter to invoke Modify.

Jump to

Keyboard shortcuts

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