summaryrefslogtreecommitdiff
path: root/internal/router/tm.go
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <145215889+SayaAndy@users.noreply.github.com> 2025-08-19 16:05:37 +0700
committerGravatar GitHub <noreply@github.com> 2025-08-19 16:05:37 +0700
commit0d8aa40ce197b10e32f2e6cc378188b71a83689f (patch)
tree0b3ed0e352836ede51e82ceaff8c9386e934802c /internal/router/tm.go
parent6401cf603f598a8008c69a14fe58f460009180a7 (diff)
parent53923cf49f46041c82bbb0cbc155e4bdcc9e1a5d (diff)
downloadweb-0.6.1.tar.gz
web-0.6.1.zip
v0.6.1v0.6.1
feat(map): enable marker clustering via plugin refactor: move template manager definition to router package
Diffstat (limited to 'internal/router/tm.go')
-rw-r--r--internal/router/tm.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/router/tm.go b/internal/router/tm.go
new file mode 100644
index 0000000..e8095ee
--- /dev/null
+++ b/internal/router/tm.go
@@ -0,0 +1,18 @@
+package router
+
+import (
+ "log/slog"
+ "os"
+
+ "github.com/SayaAndy/saya-today-web/internal/templatemanager"
+)
+
+var tm = assert(templatemanager.NewTemplateManager())
+
+func assert[T any](t T, err error) T {
+ if err != nil {
+ slog.Error("fail to initialize template manager", slog.String("error", err.Error()))
+ os.Exit(1)
+ }
+ return t
+}