Documentation ¶
Index ¶
- type App
- func (a *App) Bootstrap() error
- func (app *App) DB() *db.DB
- func (app *App) DataDir() string
- func (app *App) InitDataDB(dir string, file string, maxopenconns int, maxidleconns int) error
- func (a *App) InitDataStoreManager(db *db.DB, tablename string, idfield string) error
- func (a *App) InitDefaultTemplateRegistry() error
- func (app *App) InitLogger() error
- func (a *App) InitSessions(db *db.DB, stn, utn, idfield string, lsessexp, ssessexp int, ...) error
- func (a *App) InitSettings(dsm *datastore.DataStoreManager, key string) error
- func (a *App) InitTokens(db *db.DB, atn, utn, idfield string, lressexp, sressexp int) error
- func (a *App) InitUserTemplateRegistry(fs fs.FS, opt templates.RegistryOptions) error
- func (a *App) InitUsers(db *db.DB, utn, idfield string, uexp int, sets *models.Settings) error
- func (a *App) IsBootstrapped() bool
- func (app *App) IsDev() bool
- func (app *App) Logger() *slog.Logger
- func (a *App) RefreshSetupState() int
- func (a *App) Registry() *templates.Registry
- func (a *App) ResetBootstrapState() error
- func (app *App) Sessions() *sessions.SessionManager
- func (a *App) Settings() *models.Settings
- func (a *App) SetupState() int
- func (a *App) SystemRegistry() *templates.Registry
- func (a *App) Terminate() error
- func (app *App) Users() *users.UserManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
func (*App) Bootstrap ¶
Bootstrap initializes the application, including - database - store (a in memory key-value store) - logger - settings - built-in template registry We do not load user defined templates here; also no routes or middleware as the server is seperately initialized.
func (*App) InitDataDB ¶
func (*App) InitDataStoreManager ¶
func (*App) InitDefaultTemplateRegistry ¶
func (*App) InitLogger ¶
INFO: every init function must make sure of it's own dependencies
func (*App) InitSessions ¶
func (*App) InitSettings ¶
func (a *App) InitSettings(dsm *datastore.DataStoreManager, key string) error
func (*App) InitTokens ¶
func (*App) InitUserTemplateRegistry ¶
func (*App) IsBootstrapped ¶
func (*App) Logger ¶
Logger returns the default app logger.
If the application is not bootstrapped yet, fallbacks to slog.Default().
func (*App) RefreshSetupState ¶
func (*App) ResetBootstrapState ¶
func (*App) Sessions ¶
func (app *App) Sessions() *sessions.SessionManager
func (*App) SetupState ¶
func (*App) SystemRegistry ¶
func (*App) Users ¶
func (app *App) Users() *users.UserManager
Click to show internal directories.
Click to hide internal directories.