Documentation
¶
Overview ¶
Package developer provides a developer module for generating test data in oCMS. This module creates random tags, categories, media, and pages with translations, tracks all generated items, and allows bulk deletion.
templ: version: v0.3.1001
Index ¶
- func DeveloperPage(pc *adminviews.PageContext, data DeveloperViewData) templ.Component
- type DeveloperViewData
- type GenerateResult
- type GeneratedCounts
- type Module
- func (m *Module) AdminURL() string
- func (m *Module) AllowedEnvs() []string
- func (m *Module) Init(ctx *module.Context) error
- func (m *Module) Migrations() []module.Migration
- func (m *Module) RegisterAdminRoutes(r chi.Router)
- func (m *Module) RegisterRoutes(_ chi.Router)
- func (m *Module) Shutdown() error
- func (m *Module) SidebarLabel() string
- func (m *Module) TemplateFuncs() template.FuncMap
- func (m *Module) TranslationsFS() embed.FS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeveloperPage ¶ added in v0.9.0
func DeveloperPage(pc *adminviews.PageContext, data DeveloperViewData) templ.Component
Types ¶
type DeveloperViewData ¶ added in v0.9.0
type GenerateResult ¶
type GenerateResult struct {
Counts GeneratedCounts
TagIDs []int64
CatIDs []int64
MediaIDs []int64
PageIDs []int64
}
GenerateResult contains the result of the generation operation
type GeneratedCounts ¶
GeneratedCounts holds the counts of generated items
type Module ¶
type Module struct {
module.BaseModule
// contains filtered or unexported fields
}
Module implements the module.Module interface for the developer module.
func (*Module) AllowedEnvs ¶
AllowedEnvs restricts the developer module to non-production environments. On first run, the module will be auto-inserted as inactive if the environment is not in this list.
func (*Module) Init ¶
Init initializes the module with the given context. The developer module is blocked in production environments for security.
func (*Module) Migrations ¶
Migrations returns database migrations for the module.
func (*Module) RegisterAdminRoutes ¶
RegisterAdminRoutes registers admin routes for the module.
func (*Module) RegisterRoutes ¶
RegisterRoutes registers public routes for the module.
func (*Module) SidebarLabel ¶
SidebarLabel returns the display label for the admin sidebar.
func (*Module) TemplateFuncs ¶
TemplateFuncs returns template functions provided by the module.
func (*Module) TranslationsFS ¶
TranslationsFS returns the embedded filesystem containing module translations.