moved settings under models and added settings dao helpers

This commit is contained in:
Gani Georgiev
2022-11-26 14:42:45 +02:00
parent d8963c6fc3
commit 8c9b657132
14 changed files with 257 additions and 182 deletions
+10 -1
View File
@@ -6,6 +6,7 @@ package core
import (
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
"github.com/pocketbase/pocketbase/models/settings"
"github.com/pocketbase/pocketbase/tools/filesystem"
"github.com/pocketbase/pocketbase/tools/hook"
"github.com/pocketbase/pocketbase/tools/mailer"
@@ -47,7 +48,7 @@ type App interface {
IsDebug() bool
// Settings returns the loaded app settings.
Settings() *Settings
Settings() *settings.Settings
// Cache returns the app internal cache store.
Cache() *store.Store[any]
@@ -79,6 +80,14 @@ type App interface {
// App event hooks
// ---------------------------------------------------------------
// OnBeforeBootstrap hook is triggered before initializing the base
// application resources (eg. before db open and initial settings load).
OnBeforeBootstrap() *hook.Hook[*BootstrapEvent]
// OnAfterBootstrap hook is triggered after initializing the base
// application resources (eg. after db open and initial settings load).
OnAfterBootstrap() *hook.Hook[*BootstrapEvent]
// OnBeforeServe hook is triggered before serving the internal router (echo),
// allowing you to adjust its options and attach new routes.
OnBeforeServe() *hook.Hook[*ServeEvent]