restructure project following best practices

https://go.dev/doc/modules/layout
This also enables us to later import just the db interaction part
say to the gemini capsule backend go project.
This commit is contained in:
Travis Shears 2025-10-04 19:40:27 +02:00
parent 928c82536f
commit 360fedbebe
11 changed files with 202 additions and 169 deletions

View file

@ -1,38 +0,0 @@
package gemlog
import (
"fmt"
tea "github.com/charmbracelet/bubbletea"
)
func DeleteGemlogCMD(config *Config, id string, rev string) tea.Cmd {
return func() tea.Msg {
err := DeleteGemlogEntry(config, id, rev)
if err != nil {
return ErrorMsg{err}
}
return Notification(fmt.Sprintf("Gemlog with id: %s deleted", id))
}
}
func LoadGemlogCMD(config *Config, id string) tea.Cmd {
return func() tea.Msg {
log, err := ReadGemlogEntry(config, id)
if err != nil {
return ErrorMsg{err}
}
return GemLogLoaded{Log: log}
}
}
func LoadGemlogsCMD(config *Config) tea.Cmd {
return func() tea.Msg {
logs, err := listGemLogs(config)
if err != nil {
return ErrorMsg{err}
}
return GemLogsLoaded{Logs: logs}
}
}