command

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidId           = "%s is an invalid id"
	ErrNoTodoWithId        = "there is no todo with id %d"
	ErrNoTagWithId         = "there is no tag with id %d"
	ErrEmptyTodoNotAllowed = errors.New("empty todo is not allowed")
	ErrTagAlreadyExists    = "the tag %s already exists"
	ErrTodoDoesNotHaveTag  = "the todo %d does not have tag with id %d"
	ErrTodoAlreadyHasTag   = "the todo %d already has the tag with id %d"
	ErrTodoHasNoTags       = errors.New("the todo has no tags")
	ErrCommandNotFound     = errors.New("the command could not be found")
)

Functions

This section is empty.

Types

type AddTag added in v1.4.1

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

func (*AddTag) Execute added in v1.4.1

func (cmd *AddTag) Execute()

type AddTodo

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

func (*AddTodo) Execute

func (cmd *AddTodo) Execute()

type Clear added in v0.15.0

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

func (*Clear) Execute added in v0.15.0

func (cmd *Clear) Execute()

type Command

type Command interface {
	Execute()
}

func Fabricate added in v1.4.1

func Fabricate(todoList *model.TodoList, view view.View, flagArgs []string, list *flag.FlagSet, add *flag.FlagSet, doDelete *flag.FlagSet, toggle *flag.FlagSet, edit *flag.FlagSet, doClear *flag.FlagSet, swap *flag.FlagSet, tags *flag.FlagSet, showTagsOnTodo *int, showTodosForTag *int, tag *flag.FlagSet, tagRm *bool, tagAdd *bool, versionFlag *flag.FlagSet, version string) (Command, error)

func NewAddTag added in v1.4.1

func NewAddTag(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewAddTodo added in v0.10.0

func NewAddTodo(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewClear added in v1.2.0

func NewClear(todoList *model.TodoList, view view.View, _ string) (Command, error)

func NewDeleteTodo added in v0.10.0

func NewDeleteTodo(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewEditTodo added in v0.10.0

func NewEditTodo(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewListTags added in v1.4.1

func NewListTags(todoList *model.TodoList, view view.View, _ string) (Command, error)

func NewListTagsOnTodo added in v1.4.1

func NewListTagsOnTodo(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewListTodos added in v1.2.0

func NewListTodos(todoList *model.TodoList, view view.View, _ string) (Command, error)

func NewListTodosForTag added in v1.4.1

func NewListTodosForTag(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewPrintVersion added in v1.4.3

func NewPrintVersion(view view.View, version string) (Command, error)

func NewRemoveTag added in v1.4.1

func NewRemoveTag(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewRemoveTagFromTodo added in v1.4.1

func NewRemoveTagFromTodo(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewSwap added in v1.3.0

func NewSwap(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewTagTodo added in v1.4.1

func NewTagTodo(todoList *model.TodoList, view view.View, payload string) (Command, error)

func NewToggleTodo added in v0.10.0

func NewToggleTodo(todoList *model.TodoList, view view.View, payload string) (Command, error)

type DeleteTodo

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

func (*DeleteTodo) Execute

func (cmd *DeleteTodo) Execute()

type EditTodo

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

func (*EditTodo) Execute

func (cmd *EditTodo) Execute()

type ListTags added in v1.4.1

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

func (*ListTags) Execute added in v1.4.1

func (cmd *ListTags) Execute()

type ListTagsOnTodo added in v1.4.1

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

func (*ListTagsOnTodo) Execute added in v1.4.1

func (cmd *ListTagsOnTodo) Execute()

type ListTodos added in v1.2.0

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

func (*ListTodos) Execute added in v1.2.0

func (cmd *ListTodos) Execute()

type ListTodosForTag added in v1.4.1

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

func (*ListTodosForTag) Execute added in v1.4.1

func (cmd *ListTodosForTag) Execute()

type PrintVersion added in v1.4.3

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

func (*PrintVersion) Execute added in v1.4.3

func (cmd *PrintVersion) Execute()

type RemoveTag added in v1.4.1

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

func (*RemoveTag) Execute added in v1.4.1

func (cmd *RemoveTag) Execute()

type RemoveTagFromTodo added in v1.4.1

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

func (*RemoveTagFromTodo) Execute added in v1.4.1

func (cmd *RemoveTagFromTodo) Execute()

type Swap added in v1.3.0

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

func (*Swap) Execute added in v1.3.0

func (cmd *Swap) Execute()

type TagTodo added in v1.4.1

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

func (*TagTodo) Execute added in v1.4.1

func (cmd *TagTodo) Execute()

type ToggleTodo

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

func (*ToggleTodo) Execute

func (cmd *ToggleTodo) Execute()

Jump to

Keyboard shortcuts

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