tiki/internal/bootstrap/stores.go
2026-01-17 11:08:53 -05:00

21 lines
570 B
Go

package bootstrap
import (
"log/slog"
"os"
"github.com/boolean-maybe/tiki/config"
"github.com/boolean-maybe/tiki/store"
"github.com/boolean-maybe/tiki/store/tikistore"
)
// InitStores initializes the task stores or terminates the process on failure.
// Returns the tikiStore and a generic store interface reference to it.
func InitStores() (*tikistore.TikiStore, store.Store) {
tikiStore, err := tikistore.NewTikiStore(config.TaskDir)
if err != nil {
slog.Error("failed to initialize task store", "error", err)
os.Exit(1)
}
return tikiStore, tikiStore
}