The tm package provides a comprehensive task management system with support for task dependencies, ownership, and various task states.
This package defines interfaces and types for managing tasks in a system where:
types.go)Task: The main task entity with all task properties
TaskStatus: Enum for task states (in progress, completed, etc.)
TaskPriority: Enum for task priorities (low, medium, high, urgent)
Owner: Represents a task owner
TaskFilter: For filtering task queries
Request/Response types: For API operations
interface.go)The main interface for task management operations:
errors.go)Comprehensive error definitions:
// Create a task manager implementation var taskManager tm.TaskManager // Create a new task task, err := taskManager.CreateTask(ctx, &tm.TaskCreateRequest{ Title: "Implement user authentication", Description: "Add login and registration functionality", OwnerID: "user123", Priority: tm.PriorityHigh, }) // Start a task task, err = taskManager.StartTask(ctx, "task1") // Complete a task task, err = taskManager.CompleteTask(ctx, "task1")