taskInterface

package
v0.0.0-...-c3a30db Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CannotAddTask               = TaskErr("Cannot add task")
	CannotFindTask              = TaskErr("Task not found")
	CannotUpdateNonExistentTask = TaskErr("Cannot update non-existent task")
	NotAValidStatus             = TaskErr("Not a valid status")
)
View Source
const (
	Start = iota
	Ongoing
	Completed
	Ignored
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusEnum

type StatusEnum int

func (StatusEnum) CheckStatus

func (ss StatusEnum) CheckStatus() error

func (StatusEnum) String

func (ss StatusEnum) String() string

type Task

type Task struct {
	Name   string
	Status StatusEnum
}

type TaskErr

type TaskErr string

func (TaskErr) Error

func (e TaskErr) Error() string

type TaskList

type TaskList map[uuid.UUID]Task

func (TaskList) AddTask

func (tasks TaskList) AddTask(newTodo Task) (uuid.UUID, error)

func (TaskList) CurrentTaskLength

func (tasks TaskList) CurrentTaskLength() int

func (TaskList) DeleteTask

func (tasks TaskList) DeleteTask(id uuid.UUID)

func (TaskList) SearchTask

func (tasks TaskList) SearchTask(id uuid.UUID) (Task, error)

func (TaskList) UpdateStatus

func (tasks TaskList) UpdateStatus(id uuid.UUID, status StatusEnum) error

func (TaskList) UpdateTaskName

func (tasks TaskList) UpdateTaskName(id uuid.UUID, name string) error

type TaskServer

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

func NewTaskServer

func NewTaskServer(service TaskService) *TaskServer

type TaskService

type TaskService interface {
	CurrentTaskLength() int
	SearchTask(id uuid.UUID) (Task, error)
	AddTask(newTodo Task) (uuid.UUID, error)
	UpdateTaskName(id uuid.UUID, name string) error
	UpdateStatus(id uuid.UUID, status StatusEnum) error
	DeleteTask(id uuid.UUID)
}

Jump to

Keyboard shortcuts

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