Documentation ¶
Overview ¶
Package util provides utility functions for the schdl application.
Package util provides utility functions for the schdl application.
Package util provides utility functions for the schdl application.
Index ¶
- func ConvertInt64ToInt(fn Int64Func) (int, error)
- func PromptInput(label string) (string, error)
- func PromptInputWithDefault(label, defaultValue string) (string, error)
- func PromptSelect(label string, items []string) (string, error)
- func PromptSelectWithDefault(label string, items []string, defaultValue string) (string, error)
- func ValidateTask(task *Task) error
- type Int64Func
- type Priority
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertInt64ToInt ¶
ConvertInt64ToInt converts the result of a function returning int64 to an int. It takes a function fn of type Int64Func as input, calls it to get the int64 result, and converts it to int. It returns the converted int result and any error encountered.
func PromptInputWithDefault ¶
Create promptui Input Prompt with Default Value
func PromptSelect ¶
Create promptui Select Items
func PromptSelectWithDefault ¶
Create promptui Select Items with Default Value
func ValidateTask ¶
ValidateTask validates a task by checking its title, description, due date, and priority.
Types ¶
type Task ¶
type Task struct { // ID is the unique identifier of the task. ID int // Title is the title or name of the task. Title string // Description is the description or details of the task. Description string // DueDate is the deadline or due date of the task. DueDate time.Time // Priority is the priority level of the task. Priority Priority }
Task represents a task with its details.