Initial commit with cru (no delete) of notes

This commit is contained in:
Maximilian Friedersdorff 2025-01-26 22:23:42 +00:00
commit 1e1174f9ca
11 changed files with 244 additions and 0 deletions

30
internal/conf/conf.go Normal file
View file

@ -0,0 +1,30 @@
package conf
import (
"log"
"os"
"github.com/pelletier/go-toml"
)
type Config struct {
Extension string
NotesDir string
TemplatesDir string
}
var Conf Config
func LoadConfig(path string) {
var err error
b, err := os.ReadFile(path)
if err != nil {
log.Fatal(err)
}
err = toml.Unmarshal([]byte(b), &Conf)
if err != nil {
log.Fatal(err)
}
}