Documentation
¶
Index ¶
- Variables
- func ListLists(lists []string, tab string) string
- func RemoveIntFromSlice(s []int, val int) []int
- func Success(msg string)
- func WithDefaultDB(fn func(db *DB) error) error
- type DB
- func (db *DB) CleanAllLists() (int, error)
- func (db *DB) CleanCurrentList() (int, error)
- func (db *DB) CleanLists(names []string) (int, error)
- func (db *DB) Close() error
- func (db *DB) DeleteAllLists() error
- func (db *DB) DeleteLists(names []string) error
- func (db *DB) GetAPIKey() (string, error)
- func (db *DB) GetCurrentListName() (string, error)
- func (db *DB) GetInfo() (map[string]ListInfo, error)
- func (db *DB) GetKmapPath() (string, error)
- func (db *DB) GetList(name string) (List, error)
- func (db *DB) ListExists(name string) (bool, error)
- func (db *DB) RenameList(oldName, newName string) error
- func (db *DB) SaveList(list List) error
- func (db *DB) SetAPIKey(apiKey string) error
- func (db *DB) SetCurrentListName(name string) error
- func (db *DB) SetKmapPath(path string) error
- type List
- func (l *List) AddNewTask(description string, done bool) (int, error)
- func (l *List) AddTask(task Task) error
- func (l *List) EditTaskDescription(taskId int, newDescription string) error
- func (l *List) Insert(task Task, index int) error
- func (l *List) InsertNewTask(description string, index int) (int, error)
- func (l *List) NewTask(description string, done bool) (Task, error)
- func (l *List) RemoveTask(taskId int) error
- func (l *List) String() string
- func (l *List) ToggleCompletion(taskId int) error
- type ListInfo
- type Task
Constants ¶
This section is empty.
Variables ¶
var GeminiConfig = &genai.GenerateContentConfig{
ResponseMIMEType: "application/json",
ResponseSchema: geminiSchema,
}
Functions ¶
func RemoveIntFromSlice ¶
func WithDefaultDB ¶
A utility function that simplifies the usage of the default database.
Types ¶
type DB ¶
func InitDB ¶
Initialize the database. For testing purposes, a custom path can be provided, but it is recommended to use `os.UserConfigDir()`.
func InitDefaultDB ¶
Open DB located in user's default config dir.
func (*DB) CleanAllLists ¶
Clean up completed tasks in all lists
func (*DB) CleanCurrentList ¶
Clean up completed tasks in the current list
func (*DB) CleanLists ¶
Clean up completed tasks in the specified lists
func (*DB) DeleteLists ¶
remove the list with the given name
func (*DB) GetCurrentListName ¶
get the name of the currently active list
func (*DB) GetKmapPath ¶
func (*DB) RenameList ¶
Rename the list with the oldName to the newName. Since bbolt does not support renaming buckets, we need to completely recreate the bucket with the new name.
func (*DB) SetCurrentListName ¶
set the name of the currently active list
func (*DB) SetKmapPath ¶
type List ¶
func (*List) AddNewTask ¶
add a new task to the list and update meta data returns the id of the newly created task
func (*List) EditTaskDescription ¶
update the description of the task with the given id
func (*List) InsertNewTask ¶
insert a new task into the list at the specified index and update meta data
func (*List) NewTask ¶
make new task with the given description and completion status without adding it to the list.
func (*List) RemoveTask ¶
remove the task with the given id from the list and update meta data
func (*List) ToggleCompletion ¶
toggle the completion status of the task with the given id