quickstart

package module
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 89 Imported by: 0

README

Quickstart Defaults

The quickstart package (module github.com/goliatone/go-admin/quickstart) bundles opt-in defaults for go-admin so hosts can get a working admin with minimal wiring while keeping override hooks.

Bootstrap helpers

Each helper is optional and composable.

  • NewAdminConfig(basePath, title, defaultLocale string, opts ...AdminConfigOption) admin.Config - Inputs: base path/title/locale plus option setters. Outputs: admin.Config with quickstart defaults and overrides applied.

  • DefaultMinimalFeatures() map[string]bool - Outputs: minimal Stage 1 feature set (dashboard + cms).

  • WithDebugConfig(cfg admin.DebugConfig) AdminConfigOption - Inputs: debug config; outputs: option that applies debug config (used to derive debug gate defaults).

  • WithDebugOptions(opt DebugOption) AdminConfigOption - Inputs: explicit debug option overrides; outputs: option that applies targeted debug fields.

  • WithDebugFromEnv(opts ...DebugEnvOption) AdminConfigOption - Deprecated compatibility shim; no longer reads process environment.

  • WithErrorConfig(cfg admin.ErrorConfig) AdminConfigOption - Inputs: error config; outputs: option that applies error presentation defaults.

  • WithErrorOptions(opt ErrorOption) AdminConfigOption - Inputs: explicit error option overrides; outputs: option that applies targeted error fields.

  • WithErrorsFromEnv(opts ...ErrorEnvOption) AdminConfigOption - Deprecated compatibility shim; no longer reads process environment.

  • WithScopeConfig(scope ScopeConfig) AdminConfigOption - Inputs: scope config; outputs: option that applies single/multi-tenant defaults.

  • WithScopeMode(mode ScopeMode) AdminConfigOption - Inputs: scope mode (single or multi); outputs: option that sets the mode.

  • WithDefaultScope(tenantID, orgID string) AdminConfigOption - Inputs: default tenant/org IDs; outputs: option that sets defaults for single-tenant mode.

  • WithScopeFromEnv() AdminConfigOption - Deprecated compatibility shim; applies default scope config without env reads.

  • NewAdmin(cfg admin.Config, hooks AdapterHooks, opts ...AdminOption) (*admin.Admin, AdapterResult, error) - Inputs: config, adapter hooks, optional context/dependencies. Outputs: admin instance, adapter result summary, error.

  • WithAdapterFlags(flags AdapterFlags) AdminOption - Inputs: adapter flags; outputs: option that applies explicit adapter toggles.

  • WithFeatureDefaults(defaults map[string]bool) AdminOption - Inputs: feature default map; outputs: option that extends gate defaults used by NewAdmin.

  • WithStartupPolicy(policy StartupPolicy) AdminOption - Inputs: startup policy (enforce or warn); outputs: option controlling module startup validation handling.

  • WithTranslationProfile(profile TranslationProfile) AdminOption - Inputs: profile (none, core, core+exchange, core+queue, full); outputs: option that applies productized translation defaults.

  • WithTranslationProductConfig(cfg TranslationProductConfig) AdminOption - Inputs: product config (SchemaVersion, Profile, optional module overrides); outputs: option that resolves effective translation module wiring with deterministic precedence.

  • TranslationCapabilities(adm *admin.Admin) map[string]any - Inputs: admin instance; outputs: resolved translation capability metadata (profile, schema_version, module enablement, feature flags, routes, resolver keys, panels, warnings).

  • WithTranslationExchangeConfig(cfg TranslationExchangeConfig) AdminOption - Inputs: exchange config (disabled by default); outputs: option that enables exchange feature + command wiring when configured.

  • WithTranslationQueueConfig(cfg TranslationQueueConfig) AdminOption - Inputs: queue config (disabled by default); outputs: option that enables queue feature + panel/command wiring when configured.

  • EnablePreferences() AdminOption - Inputs: none; outputs: option to enable FeaturePreferences.

  • EnableFeature(feature admin.FeatureKey) AdminOption - Inputs: feature key; outputs: option to enable a single feature gate key.

  • RegisterTranslationExchangeWiring(adm *admin.Admin, cfg TranslationExchangeConfig) error - Inputs: admin + exchange config; outputs: error (registers exchange commands and optional permission entries).

  • RegisterTranslationQueueWiring(adm *admin.Admin, cfg TranslationQueueConfig, policyCfg TranslationPolicyConfig, hasPolicyCfg bool) error - Inputs: admin + queue config + policy context; outputs: error (registers queue panel, tabs, commands, and optional permission entries).

  • WithGoUsersPreferencesRepository(repo types.PreferenceRepository) AdminOption - Inputs: go-users preferences repo; outputs: option that wires a PreferencesStore via the adapter when one is not already set.

  • WithGoUsersPreferencesRepositoryFactory(factory func() (types.PreferenceRepository, error)) AdminOption - Inputs: repo builder; outputs: option to lazily construct a preferences repo (used when dependencies do not already supply a PreferencesStore).

  • WithGoUsersUserManagement(cfg GoUsersUserManagementConfig) AdminOption - Inputs: go-users auth/inventory/role repositories (plus optional profile repo and scope resolver); outputs: option that wires user/role/profile dependencies.

  • WithLegacyUserRoleBulkRoutes() AdminOption - Inputs: none; outputs: option that enables deprecated static user bulk role routes (/users/bulk/assign-role, /users/bulk/unassign-role) for compatibility.

  • NewUsersModule(opts ...admin.UserManagementModuleOption) *admin.UserManagementModule - Inputs: user module options; outputs: configured built-in users module.

  • NewExportBundle(opts ...ExportBundleOption) *ExportBundle - Inputs: go-export options (store/guard/actor/base path overrides). Outputs: runner/service plus go-admin registry/registrar/metadata adapters.

  • PreferencesPermissions() []PermissionDefinition - Outputs: default preferences permission definitions.

  • RegisterPreferencesPermissions(register PermissionRegisterFunc) error - Inputs: register func; outputs: error (registers default preferences permissions).

  • TranslationExchangePermissions() []PermissionDefinition - Outputs: default translation exchange permission definitions.

  • RegisterTranslationExchangePermissions(register PermissionRegisterFunc) error - Inputs: register func; outputs: error (registers translation exchange permissions).

  • TranslationQueuePermissions() []PermissionDefinition - Outputs: default translation queue permission definitions.

  • RegisterTranslationQueuePermissions(register PermissionRegisterFunc) error - Inputs: register func; outputs: error (registers translation queue permissions).

  • NewPreferencesModule(cfg admin.Config, menuParent string, opts ...PreferencesModuleOption) admin.Module - Inputs: admin config, optional menu parent, preferences module options. Outputs: configured Preferences module.

  • WithPreferencesSchemaPath(path string) PreferencesModuleOption - Inputs: schema path (file or directory); outputs: option that overrides the Preferences form schema.

  • WithPreferencesJSONEditorStrict(strict bool) PreferencesModuleOption - Inputs: strict toggle; outputs: option that enforces client-side JSON validation for raw_ui.

  • NewFiberErrorHandler(adm *admin.Admin, cfg admin.Config, isDev bool, opts ...FiberErrorHandlerOption) fiber.ErrorHandler - Inputs: admin, config, dev flag + options. Outputs: Fiber error handler.

  • WithFiberErrorMappers(mappers ...goerrors.ErrorMapper) FiberErrorHandlerOption - Inputs: extra mappers; outputs: error handler option (appended to defaults).

  • NewViewEngine(baseFS fs.FS, opts ...ViewEngineOption) (fiber.Views, error) - Inputs: base FS and view options. Outputs: Fiber views engine and error.

  • DefaultTemplateFuncs(opts ...TemplateFuncOption) map[string]any - Outputs: default template helpers (JSON, dict, singularize/pluralize, adminURL, widget titles, etc.).

  • MergeTemplateFuncs(overrides map[string]any, opts ...TemplateFuncOption) map[string]any - Inputs: overrides + optional template options. Outputs: merged map for WithViewTemplateFuncs.

  • WithTemplateURLResolver(urls urlkit.Resolver) TemplateFuncOption - Inputs: URLKit resolver; outputs: option that configures adminURL to resolve via URLKit.

  • WithViewURLResolver(urls urlkit.Resolver) ViewEngineOption - Inputs: URLKit resolver; outputs: option that configures adminURL to resolve via URLKit.

  • WithThemeContext(ctx router.ViewContext, adm *admin.Admin, req router.Context) router.ViewContext - Inputs: view context, admin, request. Outputs: context enriched with theme tokens/selection.

  • WithNav(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, active string, reqCtx context.Context) router.ViewContext - Inputs: base view context + admin/config/request state. Outputs: context enriched with feature flags (activity_enabled, activity_feature_enabled, translation_capabilities, body_classes), session user payload, nav items, theme payload, and path helpers.

  • WithNavPlacements(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, placements PlacementConfig, placement string, active string, reqCtx context.Context) router.ViewContext - Inputs: same as WithNav, plus placement mapping. Outputs: placement-aware nav context for non-sidebar menus while preserving the same feature/session/theme enrichment.

  • BuildPanelExportConfig(cfg admin.Config, opts PanelViewCapabilityOptions) map[string]any - Inputs: admin config and panel capability options. Outputs: normalized export_config payload (endpoint, definition, optional variant).

  • BuildPanelDataGridConfig(opts PanelDataGridConfigOptions) map[string]any - Inputs: datagrid options. Outputs: normalized datagrid_config payload (table_id, api_endpoint, action_base, optional preferences_endpoint, column_storage_key, optional state_store and url_state).

  • BuildPanelViewCapabilities(cfg admin.Config, opts PanelViewCapabilityOptions) router.ViewContext - Inputs: admin config and panel capability options. Outputs: template capability context including export_config and datagrid_config.

  • PathViewContext(cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext - Inputs: config + path resolver hints. Outputs: normalized base_path, api_base_path, asset_base_path, preferences_api_path.

  • WithPathViewContext(ctx router.ViewContext, cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext - Inputs: existing context + path resolver hints. Outputs: merged context with canonical path keys.

  • WithThemeSelector(selector theme.ThemeSelector, manifest *theme.Manifest) AdminOption - Inputs: go-theme selector + manifest; outputs: option that wires theme selection + manifest into NewAdmin (including Preferences variant options).

  • NewFiberServer(viewEngine fiber.Views, cfg admin.Config, adm *admin.Admin, isDev bool, opts ...FiberServerOption) (router.Server[*fiber.App], router.Router[*fiber.App]) - Inputs: views, config, admin, dev flag, server options. Outputs: go-router server adapter and router.

  • NewThemeSelector(name, variant string, tokenOverrides map[string]string, opts ...ThemeOption) (theme.Selector, *theme.Manifest, error) - Inputs: theme name/variant, token overrides, theme options. Outputs: selector, manifest, error.

  • NewStaticAssets(r router.Router[T], cfg admin.Config, assetsFS fs.FS, opts ...StaticAssetsOption) - Inputs: router, config, host assets FS, asset options. Outputs: none (registers static routes).

  • ResolveDiskAssetsDir(marker string, candidates ...string) string - Inputs: marker file + candidate directories. Outputs: first matching directory.

  • RegisterAdminUIRoutes(r router.Router[T], cfg admin.Config, adm *admin.Admin, auth admin.HandlerAuthenticator, opts ...UIRouteOption) error - Inputs: router/config/admin/auth wrapper + options. Outputs: error (registers dashboard + notifications UI routes, and injects feature-aware view context such as activity_enabled + body_classes).

  • WithContentEntryDataGridStateStore(cfg PanelDataGridStateStoreOptions) ContentEntryUIOption - Inputs: DataGrid state-store config for content-entry list templates. Outputs: content-entry route option (default mode remains localStorage when unset).

  • WithContentEntryDataGridURLState(cfg PanelDataGridURLStateOptions) ContentEntryUIOption - Inputs: URL sync limits/token config for content-entry list templates. Outputs: content-entry route option.

  • RegisterAuthUIRoutes(r router.Router[T], cfg admin.Config, auther *auth.Auther, cookieName string, opts ...AuthUIOption) error - Inputs: router/config/go-auth auther/cookie name + options. Outputs: error (registers login/logout/reset UI routes).

  • RegisterRegistrationUIRoutes(r router.Router[T], cfg admin.Config, opts ...RegistrationUIOption) error - Inputs: router/config + options. Outputs: error (registers signup UI route).

  • AuthUIViewContext(cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext - Inputs: config/state/paths; outputs: view context with auth flags + paths (base_path, api_base_path, asset_base_path, preferences_api_path).

  • AttachDebugMiddleware(r router.Router[T], cfg admin.Config, adm *admin.Admin) - Inputs: router/config/admin; outputs: none (registers debug request capture middleware).

  • AttachDebugLogHandler(cfg admin.Config, adm *admin.Admin) - Inputs: config/admin; outputs: none (wires slog debug handler).

  • ConfigureExportRenderers(bundle *ExportBundle, templatesFS fs.FS, opts ...ExportTemplateOption) error - Inputs: export bundle + templates FS + options. Outputs: error (registers template/PDF renderers).

  • NewModuleRegistrar(adm *admin.Admin, cfg admin.Config, modules []admin.Module, isDev bool, opts ...ModuleRegistrarOption) error - Inputs: admin, config, module list, dev flag, options. Outputs: error.

  • WithModuleFeatureGates(gates gate.FeatureGate) ModuleRegistrarOption - Inputs: feature gate; outputs: option to filter modules/menu items.

  • WithModuleFeatureDisabledHandler(handler func(feature, moduleID string) error) ModuleRegistrarOption - Inputs: handler; outputs: option for disabled modules.

  • WithTranslationCapabilityMenuMode(mode TranslationCapabilityMenuMode) ModuleRegistrarOption - Inputs: translation menu seeding mode (tools default, none opt-out); outputs: option controlling whether translation dashboard/queue/exchange links are added to server-seeded navigation.

  • DefaultContentParentPermissions() []string - Outputs: canonical permission set used by the default sidebar Content parent (media, content_types, block_definitions).

  • WithGoAuth(adm *admin.Admin, routeAuth *auth.RouteAuthenticator, cfg auth.Config, authz admin.GoAuthAuthorizerConfig, authCfg *admin.AuthConfig, opts ...admin.GoAuthAuthenticatorOption) (*admin.GoAuthAuthenticator, *admin.GoAuthAuthorizer) - Inputs: admin, route auth, auth config, authz config, admin auth config, options. Outputs: adapters.

  • WithDefaultDashboardRenderer(adm *admin.Admin, viewEngine fiber.Views, cfg admin.Config, opts ...DashboardRendererOption) error - Inputs: admin, view engine, config, renderer options. Outputs: error.

  • WithDashboardTemplatesFS(fsys fs.FS) DashboardRendererOption - Inputs: template FS; outputs: renderer option for overrides.

  • WithDashboardEmbeddedTemplates(enabled bool) DashboardRendererOption - Inputs: boolean; outputs: renderer option to enable/disable embedded templates.

  • NewCompositeActivitySink(primary admin.ActivitySink, hooks dashboardactivity.Hooks, cfg dashboardactivity.Config) admin.ActivitySink - Inputs: primary sink, dashboard hooks/config. Outputs: activity sink bridge.

  • NewGoAuthActivitySink(sink admin.ActivitySink, opts ...GoAuthActivitySinkOption) auth.ActivitySink - Inputs: admin sink + options. Outputs: go-auth activity adapter.

  • NewSharedActivitySinks(primary admin.ActivitySink, hooks dashboardactivity.Hooks, cfg dashboardactivity.Config, opts ...GoAuthActivitySinkOption) SharedActivitySinks - Inputs: primary sink + dashboard hooks/config. Outputs: shared admin/go-auth sinks.

  • NewFormGenerator(openapiFS fs.FS, templatesFS fs.FS, opts ...FormGeneratorOption) (*formgenorchestrator.Orchestrator, error) - Inputs: OpenAPI FS, templates FS, optional configuration. Outputs: form generator orchestrator and error.

  • WithComponentRegistry(reg *components.Registry) FormGeneratorOption - Inputs: custom registry; outputs: option that replaces default components (clean replace).

  • WithComponentRegistryMergeDefaults(reg *components.Registry) FormGeneratorOption - Inputs: custom registry; outputs: option that merges into defaults, overriding matching names.

  • WithVanillaOption(opt formgenvanilla.Option) FormGeneratorOption - Inputs: vanilla renderer option; outputs: option applied last so it can override templates/styles/registry.

  • DefaultSecureLinkConfig(basePath string) SecureLinkConfig - Inputs: base path; outputs: securelink defaults.

  • SecureLinkConfigFromEnv(basePath string) SecureLinkConfig - Deprecated compatibility shim; returns defaults and does not read environment.

  • DefaultSecureLinkRoutes(basePath string) map[string]string - Inputs: base path; outputs: securelink routes map.

  • NewSecureLinkManager(cfg SecureLinkConfig) (types.SecureLinkManager, error) - Inputs: securelink config; outputs: go-users securelink manager.

  • NewNotificationsSecureLinkManager(cfg SecureLinkConfig) (links.SecureLinkManager, error) - Inputs: securelink config; outputs: go-notifications securelink manager (delegates to go-notifications/adapters/securelink.NewManager).

  • ApplySecureLinkManager(cfg *userssvc.Config, manager types.SecureLinkManager, opts ...SecureLinkUsersOption) - Inputs: go-users config + manager; outputs: config mutated with securelink routes/manager.

  • NewSecureLinkNotificationBuilder(manager links.SecureLinkManager, opts ...linksecure.Option) links.LinkBuilder - Inputs: notification manager + options; outputs: notification link builder.

  • RegisterOnboardingRoutes(r router.Router[T], cfg admin.Config, handlers OnboardingHandlers, opts ...OnboardingRouteOption) error - Inputs: router/config/handlers; outputs: error (registers onboarding API routes).

  • RegisterUserMigrations(client *persistence.Client, opts ...UserMigrationsOption) error - Inputs: persistence client + options; outputs: error (registers go-auth/go-users migrations using canonical profiles + source labels).

User management

Quickstart can wire go-users repositories and expose the built-in users module. The users feature flag is enabled by default in DefaultAdminFeatures(); if you disable it, the users module is skipped and user/role endpoints return FeatureDisabledError.

Use WithGoUsersUserManagement to provide the required repositories (AuthRepo, InventoryRepo, RoleRegistry) and optional ProfileRepo + ScopeResolver. This wires UserRepository, RoleRepository, and (when provided) ProfileStore.

Bulk role operations should use panel bulk routes (/panels/:panel/bulk/:action, e.g. /admin/api/panels/users/bulk/assign-role). Legacy static routes are disabled by default; enable them only for compatibility:

quickstart.WithLegacyUserRoleBulkRoutes()

Quickstart Fiber defaults use prefer_static path conflict resolution, so absolute static routes (for example /users/bulk/assign-role) can coexist with wildcard siblings (for example /users/bulk/:action) deterministically. Override path conflict behavior with WithFiberAdapterConfig(...). Quickstart also defaults Fiber request-header ReadBufferSize to 16KB; override with WithFiberConfig(...) when your deployment needs a different limit.

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en")

adm, _, err := quickstart.NewAdmin(
\tcfg,
\tquickstart.AdapterHooks{},
\tquickstart.WithGoUsersUserManagement(quickstart.GoUsersUserManagementConfig{
\t\tAuthRepo:      authRepo,
\t\tInventoryRepo: inventoryRepo,
\t\tRoleRegistry:  roleRegistry,
\t\tProfileRepo:   profileRepo,   // optional
\t\tScopeResolver: scopeResolver, // optional
\t}),
)
if err != nil {
\treturn err
}

_ = adm.RegisterModule(quickstart.NewUsersModule(
\tadmin.WithUserMenuParent("main"),
\tadmin.WithUserProfilesPanel(), // opt-in managed profiles panel
\tadmin.WithUserPanelTabs(admin.PanelTab{
\t\tID:     "activity",
\t\tLabel:  "Activity",
\t\tScope:  admin.PanelTabScopeDetail,
\t\tTarget: admin.PanelTabTarget{Type: "path", Path: "/admin/users/:id/activity"},
\t}),
))

The managed profiles panel and activity tab are opt-in; omit WithUserProfilesPanel or WithUserPanelTabs to keep the default users panel.

All user management URLs should resolve via URLKit (admin namespace). Defaults:

  • adm.URLs().Resolve("admin.users") -> /admin/users
  • adm.URLs().Resolve("admin.roles") -> /admin/roles
  • Panel API collection endpoints are canonical under /admin/api/panels/<panel> (for example /admin/api/panels/users, /admin/api/panels/roles).
  • Panel API detail endpoints are canonical under /admin/api/panels/<panel>/<id>.
  • adm.URLs().Resolve("admin.user_profiles") -> /admin/user-profiles (when the profiles panel is enabled)

Panel entry behavior:

  • Canonical panel UI routes (registered by RegisterContentEntryUIRoutes) now honor PanelBuilder.WithEntryMode(...).
  • profile defaults to admin.PanelEntryModeDetailCurrentUser, so GET /admin/profile resolves to the current user detail view instead of the profile datagrid/list.
  • Panels without explicit entry mode use admin.PanelEntryModeList.

To opt a panel into a different canonical entry point:

usersModule := quickstart.NewUsersModule(
	admin.WithUsersPanelConfigurer(func(builder *admin.PanelBuilder) *admin.PanelBuilder {
		if builder == nil {
			return nil
		}
		return builder.WithEntryMode(admin.PanelEntryModeDetailCurrentUser)
	}),
)
_ = usersModule

Bulk role routes are auto-registered by quickstart when users is enabled:

  • adm.URLs().Resolve("admin.api.users.bulk.assign_role") -> /admin/api/users/bulk/assign-role
  • adm.URLs().Resolve("admin.api.users.bulk.unassign_role") -> /admin/api/users/bulk/unassign-role

Translation exchange (opt-in)

Translation exchange is disabled by default in quickstart. Enable it explicitly with WithTranslationExchangeConfig(...).

Translation product profiles

Quickstart supports one product-level translation entry point:

quickstart.WithTranslationProductConfig(quickstart.TranslationProductConfig{
	SchemaVersion: 1, // defaults to 1
	Profile:       quickstart.TranslationProfileCore, // default for cms-enabled apps
	Exchange:      nil, // optional module override
	Queue:         nil, // optional module override
})

Supported profiles:

  • none
  • core
  • core+exchange
  • core+queue
  • full

Deterministic precedence order:

  1. Profile baseline (core default when cms is enabled, otherwise none).
  2. Product module overrides (TranslationProductConfig.Exchange / Queue).
  3. Legacy options (WithTranslationExchangeConfig, WithTranslationQueueConfig) as final compatibility overrides.

When exchange is enabled through profiles, quickstart still validates that required exchange handlers are configured. If cms is disabled, any effective profile/module enablement other than none fails startup with a typed translation product config error. Quickstart publishes resolved translation metadata to both:

  • quickstart.TranslationCapabilities(adm) for backend/example wiring.
  • translation_capabilities in UI route view context and quickstart.WithNav(...) context for template/frontend gating.
  • Startup diagnostics log event: translation.capabilities.startup (INFO) with profile, schema_version, module enablement, feature flags, routes, panels, resolver keys, and warnings.
  • Validation failures log translation.capabilities.startup (ERROR) with deterministic fields: error_code, error_message, hint, failed_checks.
  • SchemaVersion=0 is treated as a supported legacy input and normalized to schema version 1 with warning translation.productization.schema.upconverted.
  • Explicit translation module feature overrides in WithFeatureDefaults are honored (translations.exchange, translations.queue) before dependency validation.
  • dashboard=false only suppresses dashboard exposure; it does not disable translation policy enforcement or queue/exchange wiring by itself.
Migration and compatibility contract

Product wiring and legacy manual wiring can coexist during migration.

  • Conflict handling is deterministic: legacy module options are applied after profile + product module overrides.
  • Mixed product+legacy usage emits warning translation.productization.legacy_override.
  • Switching to product config changes runtime wiring source only and must not mutate persisted translation records, exchange artifacts, or queue assignments.
  • Legacy manual wiring options remain supported for at least two minor releases after product API GA.

Detailed contract and rollout rules: ../docs/GUIDE_CMS.md#177-translation-productization-contract.

Minimal in-process wiring:

adm, _, err := quickstart.NewAdmin(
	cfg,
	quickstart.AdapterHooks{},
	quickstart.WithTranslationExchangeConfig(quickstart.TranslationExchangeConfig{
		Enabled: true,
		Store:   translationExchangeStore, // implements admin.TranslationExchangeStore
	}),
)
if err != nil {
	return err
}

Optional permission registration:

err := quickstart.RegisterTranslationExchangePermissions(func(def quickstart.PermissionDefinition) error {
	// host permission catalog integration
	return permissionRegistry.Register(def.Key, def.Description)
})

Permission ownership:

  • Quickstart defines and can register translation permission keys into a host permission catalog.
  • Quickstart does not create roles or assign permissions to users.
  • The host application must seed/assign permissions for every role that should access exchange/queue routes.
  • Exchange endpoints require:
    • admin.translations.export -> POST /admin/api/translations/export
    • admin.translations.import.view -> GET /admin/api/translations/template
    • admin.translations.import.validate -> POST /admin/api/translations/import/validate
    • admin.translations.import.apply -> POST /admin/api/translations/import/apply

Optional async apply integration for production workers:

quickstart.WithTranslationExchangeConfig(quickstart.TranslationExchangeConfig{
	Enabled: true,
	Store:   translationExchangeStore,
	AsyncApply: func(ctx context.Context, input admin.TranslationImportApplyInput) (admin.TranslationExchangeResult, error) {
		// enqueue job in external worker and return queued contract
		return admin.TranslationExchangeResult{
			Summary: admin.TranslationExchangeSummary{
				Processed: len(input.Rows),
			},
			Metadata: map[string]any{"queued": true},
		}, nil
	},
})
Exchange contract and trigger reuse

Exchange adapters should preserve one command contract across HTTP, CLI, and jobs.

HTTP routes:

  • POST /admin/api/translations/export
  • GET /admin/api/translations/template
  • POST /admin/api/translations/import/validate
  • POST /admin/api/translations/import/apply

Row linkage fields (rows[*]):

  • resource
  • entity_id
  • translation_group_id
  • target_locale
  • field_path

Safety semantics:

  • Run validate before apply.
  • apply never auto-publishes imported rows.
  • Missing locale variants require explicit create intent (create_translation).
  • source_hash mismatch is a typed row conflict unless explicitly overridden.
  • Duplicate linkage rows in one payload produce deterministic row conflicts and do not write duplicate changes.

Trigger command names:

  • admin.translations.exchange.import.run (typed run command)
  • jobs.translations.exchange.import.run (cron/manual trigger)

Job wrapper:

  • examples/web/jobs.NewTranslationImportRunJob(...) builds a cron trigger command that dispatches the same typed run message contract.

Translation queue (opt-in)

Translation queue is disabled by default in quickstart. Enable it with WithTranslationQueueConfig(...).

Minimal wiring:

policyCfg := quickstart.TranslationPolicyConfig{
	Required: map[string]quickstart.TranslationPolicyEntityConfig{
		"catalog_items": {
			"publish": {Locales: []string{"en", "es"}},
		},
	},
}

adm, _, err := quickstart.NewAdmin(
	cfg,
	quickstart.AdapterHooks{},
	quickstart.WithTranslationPolicyConfig(policyCfg),
	quickstart.WithTranslationQueueConfig(quickstart.TranslationQueueConfig{
		Enabled: true,
		// Optional: provide repository/service overrides.
		// Repository: admin.NewInMemoryTranslationAssignmentRepository(),
	}),
)
if err != nil {
	return err
}

Locale alignment rule:

  • If supported_locales is omitted, quickstart derives queue locales from active translation policy requirements.
  • If supported_locales is explicitly set and policy locales are available, sets must match exactly or startup fails with ErrTranslationQueueConfig.

Optional permission registration:

err := quickstart.RegisterTranslationQueuePermissions(func(def quickstart.PermissionDefinition) error {
	return permissionRegistry.Register(def.Key, def.Description)
})

Queue permission map:

  • admin.translations.view -> queue list/detail read access.
  • admin.translations.assign -> queue create/new and assign/release actions.
  • admin.translations.edit -> submit-review/update flows.
  • admin.translations.approve -> approve/reject review actions.
  • admin.translations.manage -> archive/manage/bulk lifecycle actions.
  • admin.translations.claim -> claim open-pool assignments.

Auth note:

  • Non-CRUD permissions (for example admin.translations.export and admin.translations.assign) are checked as explicit permission strings.
  • After changing role permissions, reload the page so permission checks and diagnostics reflect current role assignments.

URL configuration

Quickstart defaults still mount admin under /admin and the public API under /api/v1, but the canonical URL surface now lives in cfg.URLs.

Example:

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en")
cfg.URLs.Admin.BasePath = "/control"
cfg.URLs.Admin.APIPrefix = "api"
cfg.URLs.Public.APIVersion = "v2"

If you need full control, set cfg.URLs.URLKit to a custom URLKit config and use adm.URLs() for template helpers and route registration.

For panel-backed navigation targets, prefer canonical panel URL helpers instead of hardcoded paths:

  • quickstart.ResolveAdminPanelURL(adm.URLs(), cfg.BasePath, "<panel>")

The helper resolves the canonical panel entry URL. When a panel opts into PanelEntryModeDetailCurrentUser, that same URL opens detail for the current authenticated user.

Scope defaults (single vs multi-tenant)

Quickstart can enforce a single-tenant default scope or require explicit tenant/org claims for multi-tenant projects.

Modes:

  • single (default): injects default tenant/org IDs when claims are missing.
  • multi: never injects defaults; scope must come from auth claims/metadata.

Defaults:

  • tenant: 11111111-1111-1111-1111-111111111111
  • org: 22222222-2222-2222-2222-222222222222

Explicit config:

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en",
	quickstart.WithScopeConfig(quickstart.ScopeConfig{
		Mode:            quickstart.ScopeModeSingle,
		DefaultTenantID: "11111111-1111-1111-1111-111111111111",
		DefaultOrgID:    "22222222-2222-2222-2222-222222222222",
	}),
)

WithScopeFromEnv() remains available for compatibility, but it no longer reads process environment and only applies normalized defaults.

Template functions

NewViewEngine wires DefaultTemplateFuncs() when no template functions are supplied. Prefer WithViewURLResolver(adm.URLs()) (or WithTemplateURLResolver(adm.URLs())) so adminURL resolves via URLKit; WithViewBasePath(cfg.BasePath) remains as a fallback for legacy setups. WithViewTemplateFuncs is a strict override; use MergeTemplateFuncs if you want to keep defaults and add/override a subset. The go-router Pongo2 engine treats these helpers as functions (globals), not filters, so call them like {{ singularize(resource_label|default:resource)|title }} instead of {{ resource_label|singularize }}.

Template function options let you override widget title labels without touching the core map:

  • WithWidgetTitleOverrides(overrides map[string]string) TemplateFuncOption - merges label overrides into defaults.
  • WithWidgetTitleMap(titles map[string]string) TemplateFuncOption - replaces the default map entirely.
  • WithWidgetTitleFunc(fn func(string) string) TemplateFuncOption - provides a custom resolver.
  • Widget definition constants are available via admin.Widget..., for example admin.WidgetUserProfileOverview.
  • WithTemplateBasePath(basePath string) TemplateFuncOption - sets the fallback base path used by the adminURL helper.
  • WithTemplateURLResolver(urls urlkit.Resolver) TemplateFuncOption - configures the URLKit resolver used by adminURL.
  • WithTemplateFeatureGate(gate fggate.FeatureGate, opts ...fgtemplates.HelperOption) TemplateFuncOption - registers feature gate template helpers (featureEnabled, featureDisabled, etc.) from go-featuregate.
  • WithTemplateIconRenderer(renderFunc func(ref string, variant string) string) TemplateFuncOption - injects a custom icon renderer for renderIcon and renderIconVariant helpers; if not provided, templates use the built-in legacy icon rendering.
funcs := quickstart.MergeTemplateFuncs(
	map[string]any{
		"titleize": strings.ToUpper,
	},
	quickstart.WithTemplateURLResolver(adm.URLs()),
	quickstart.WithTemplateBasePath(cfg.BasePath),
	quickstart.WithWidgetTitleOverrides(map[string]string{
		admin.WidgetUserProfileOverview: "Profile Overview",
	}),
)

views, err := quickstart.NewViewEngine(
	os.DirFS("./web"),
	quickstart.WithViewTemplateFuncs(funcs),
)
if err != nil {
	return err
}

UI routes

Quickstart includes opt-in helpers for common UI routes (admin shell, notifications, login/logout, password reset).

if err := quickstart.RegisterAdminUIRoutes(router, cfg, adm, authn); err != nil {
	return err
}

if err := quickstart.RegisterAuthUIRoutes(
	router,
	cfg,
	auther,
	authCookieName,
	quickstart.WithAuthUITitles("Login", "Password Reset"),
); err != nil {
	return err
}

if err := quickstart.RegisterRegistrationUIRoutes(
	router,
	cfg,
	quickstart.WithRegistrationUITitle("Register"),
); err != nil {
	return err
}

if err := quickstart.RegisterContentEntryUIRoutes(
	router,
	cfg,
	adm,
	authn,
	quickstart.WithContentEntryDataGridStateStore(quickstart.PanelDataGridStateStoreOptions{
		Mode: "preferences", // optional; default is local storage when unset
	}),
	quickstart.WithContentEntryDataGridURLState(quickstart.PanelDataGridURLStateOptions{
		MaxURLLength:     1800,
		MaxFiltersLength: 600,
	}),
); err != nil {
	return err
}

When canonical panel UI routes are active (PanelUIRouteModeCanonical), the base panel route (/admin/<panel>) uses the panel entry mode. For example, detail_current_user renders detail for the authenticated user; default mode remains list/datagrid.

Panel list template contract

For list templates rendered from quickstart panel/content-entry routes, use datagrid_config as the canonical contract for DataGrid wiring:

  • datagrid_config.table_id
  • datagrid_config.api_endpoint
  • datagrid_config.action_base
  • datagrid_config.preferences_endpoint (optional; resolved panel preferences API path)
  • datagrid_config.column_storage_key
  • datagrid_config.state_store (optional: {mode, resource, sync_debounce_ms, max_share_entries})
  • datagrid_config.url_state (optional: {max_url_length, max_filters_length, enable_state_token})
  • datagrid_config.export_config

State persistence behavior:

  • default mode is localStorage (state_store omitted or mode=local).
  • optional preferences mode (mode=preferences) hydrates/syncs user state through /api/panels/preferences, with local cache fallback.
  • URL sync writes compact query state; when limits are exceeded, DataGrid can fallback to state=<token> instead of writing large query payloads.

Compatibility keys (datatable_id, list_api, action_base, export_config) are still present for legacy templates, but new/updated templates should read from datagrid_config first.

Password reset UI defaults to two pages:

  • Request: /admin/password-reset (template password_reset)
  • Confirm: /admin/password-reset/confirm (template password_reset_confirm)

Override the confirm route or template with WithAuthUIPasswordResetConfirmPath and WithAuthUIPasswordResetConfirmTemplate.

Theme assets for auth UI

Auth and registration UI routes support theme assets (logo, favicon) via dedicated options. Assets are exposed in templates as theme.assets.logo, theme.assets.favicon, etc.

authThemeAssets := map[string]string{
	"logo":    "logo.svg",
	"favicon": "favicon.svg",
}
authThemeAssetPrefix := path.Join(cfg.BasePath, "assets")

if err := quickstart.RegisterAuthUIRoutes(
	router,
	cfg,
	auther,
	authCookieName,
	quickstart.WithAuthUITitles("Login", "Password Reset"),
	quickstart.WithAuthUIThemeAssets(authThemeAssetPrefix, authThemeAssets),
); err != nil {
	return err
}

if err := quickstart.RegisterRegistrationUIRoutes(
	router,
	cfg,
	quickstart.WithRegistrationUITitle("Register"),
	quickstart.WithRegistrationUIThemeAssets(authThemeAssetPrefix, authThemeAssets),
); err != nil {
	return err
}

For manual route handlers, use WithAuthUIViewThemeAssets to merge theme assets into the view context:

viewCtx := router.ViewContext{
	"title":     cfg.Title,
}
viewCtx = quickstart.WithPathViewContext(viewCtx, cfg, quickstart.PathViewContextConfig{
	BasePath: cfg.BasePath,
})
viewCtx = quickstart.WithAuthUIViewThemeAssets(viewCtx, authThemeAssets, authThemeAssetPrefix)
return c.Render("register", viewCtx)

For non-auth/public handlers, prefer the same path helper before rendering templates that link JS/CSS assets:

viewCtx := quickstart.WithPathViewContext(nil, cfg, quickstart.PathViewContextConfig{
	BasePath:    cfg.BasePath,
	APIBasePath: "/api/v1/public",
})

Templates use a conditional fallback pattern:

{% if theme and theme.assets and theme.assets.logo %}
<img src="{{ theme.assets.logo }}" alt="Logo" class="w-10 h-10" />
{% else %}
<!-- inline SVG fallback -->
{% endif %}

CMS workflow defaults

Quickstart defaults wire CMS workflows for demo panels when you do not provide a custom engine. To start from defaults and override only a subset, register defaults before your overrides or opt in to default registration on a custom engine:

workflow := admin.NewFSMWorkflowEngine()
admin.RegisterDefaultCMSWorkflows(workflow)
workflow.RegisterWorkflow("content", admin.WorkflowDefinition{
    EntityType:   "content",
    InitialState: "draft",
    Transitions: []admin.WorkflowTransition{
        {Name: "submit_for_approval", From: "draft", To: "approval"},
        {Name: "publish", From: "approval", To: "published"},
    },
})

adm, _, err := quickstart.NewAdmin(
    cfg,
    hooks,
    quickstart.WithAdminDependencies(admin.Dependencies{
        Workflow: workflow,
    }),
)
if err != nil {
    return err
}
adm.WithCMSWorkflowDefaults()

Workflow capability precedence for dynamic content panels:

  1. workflow_id (aliases: workflowId, workflow-id)
  2. legacy workflow
  3. trait default mapping configured through quickstart/admin options
  4. no workflow

Configure trait defaults at bootstrap:

adm, _, err := quickstart.NewAdmin(
    cfg,
    hooks,
    quickstart.WithAdminDependencies(admin.Dependencies{
        Workflow: workflow,
    }),
    quickstart.WithTraitWorkflowDefaults(map[string]string{
        "editorial": "editorial.default",
    }),
)
if err != nil {
    return err
}

Content type capability examples:

{
  "panel_traits": ["editorial"],
  "workflow_id": "editorial.news"
}
{
  "panel_traits": ["editorial"],
  "workflow": "editorial.default"
}

Migration guidance:

  1. Keep legacy workflow keys initially.
  2. Add trait defaults (WithTraitWorkflowDefaults) for shared defaults.
  3. Add explicit workflow_id for content types that must override defaults.
  4. Remove legacy workflow after validation.

External workflow config (YAML/JSON) can be loaded at startup:

schema_version: 1
trait_defaults:
  editorial: editorial.default
workflows:
  editorial.default:
    initial_state: draft
    transitions:
      - name: submit_for_approval
        from: draft
        to: approval
      - name: publish
        from: approval
        to: published
  editorial.news:
    initial_state: draft
    transitions:
      - name: submit_for_approval
        from: draft
        to: approval
      - name: publish
        from: approval
        to: published
adm, _, err := quickstart.NewAdmin(
    cfg,
    hooks,
    quickstart.WithWorkflowConfigFile("workflow_config.yaml"),
)

Validation fails fast with actionable field errors for:

  • unsupported schema versions
  • invalid workflow definitions (missing initial_state, transition fields, duplicate transition names)
  • trait defaults referencing unknown workflow IDs

Persisted workflow runtime (Stage 3) can be wired for dynamic workflow and binding management:

runtime := admin.NewWorkflowRuntimeService(
    admin.NewInMemoryWorkflowDefinitionRepository(),
    admin.NewInMemoryWorkflowBindingRepository(),
)

adm, _, err := quickstart.NewAdmin(
    cfg,
    hooks,
    quickstart.WithAdminDependencies(admin.Dependencies{
        Workflow: admin.NewFSMWorkflowEngine(),
    }),
    quickstart.WithWorkflowRuntime(runtime),
)

Runtime binding resolution order is:

  1. content type binding
  2. trait binding
  3. global binding

Capability precedence is unchanged: explicit workflow_id/workflow on the content type still wins over persisted bindings.

Workflow management API endpoints:

  • GET /admin/api/workflows
  • POST /admin/api/workflows
  • PUT /admin/api/workflows/:id (expected_version required for updates; rollback_to_version enables rollback)
  • GET /admin/api/workflows/bindings
  • POST /admin/api/workflows/bindings
  • PUT /admin/api/workflows/bindings/:id (expected_version required)
  • DELETE /admin/api/workflows/bindings/:id

Operational migration/rollback details: ../docs/WORKFLOW_PERSISTENCE.md.

CMS demo panels default to the submit_for_approval and publish actions. Override them with:

adm.WithCMSWorkflowActions(
    admin.Action{Name: "submit_for_approval", Label: "Submit for approval"},
    admin.Action{Name: "publish", Label: "Publish"},
)

Translation policy (workflow enforcement)

Quickstart can enforce translation completeness during workflow transitions (publish/promote). Provide a TranslationPolicyConfig via WithTranslationPolicyConfig; quickstart wires the default policy when the config is present (or when deny_by_default/required are set).

Config example (YAML/JSON):

translation_policy:
  deny_by_default: false
  required_fields_strategy: "error" # error|warn|ignore
  page_entities: ["landing_pages"] # optional: entities that should use page checker
  entity_aliases:
    article: news
  required:
    landing_pages:
      publish:
        locales: ["en", "es"]
      promote:
        environments:
          staging:
            locales: ["en"]
          prod:
            locales: ["en", "es", "fr"]
    articles:
      publish:
        locales: ["en"]
        required_fields:
          en: ["title", "path"]

Behavior notes:

  • required keys map to policy entities (panel slug or content type slug). If a payload includes policy_entity/policyEntity, it overrides the entity lookup.
  • When both page/content translation checkers are present, page_entities can declare which entities should prefer the page checker.
  • Entity lookup is singular/plural tolerant (for example item vs items) using inflection-based matching against configured required keys.
  • Use entity_aliases for irregular/legacy names that need explicit mapping.
  • Transition names are the workflow transition names (publish, promote, etc.).
  • If an environment match is present, it overrides transition-level locales/required_fields for that transition.
  • required_fields is a map of locale → required field keys. If locales is empty but required_fields is set, locales are derived from the map keys.
  • required_fields_strategy controls how unknown field keys are handled during validation (error, warn, ignore).
  • deny_by_default=true blocks transitions when no requirements are configured for a transition.
  • Operational contract and troubleshooting workflow: ../docs/GUIDE_CMS.md#17-translation-workflow-operations.

Wiring example:

policyCfg := quickstart.TranslationPolicyConfig{
	Required: map[string]quickstart.TranslationPolicyEntityConfig{
		"articles": {
			"publish": {Locales: []string{"en", "es"}},
		},
	},
}

adm, _, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithTranslationPolicyConfig(policyCfg),
)
if err != nil {
	return err
}
Theme selector + manifest

When using go-theme, pass the selector + manifest into quickstart so the Preferences UI can list available variants:

selector, manifest, err := quickstart.NewThemeSelector(
	cfg.Theme,
	cfg.ThemeVariant,
	cfg.ThemeTokens,
)
if err != nil {
	return err
}

adm, _, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithThemeSelector(selector, manifest),
)
if err != nil {
	return err
}
_ = adm

If you build the admin manually, call adm.WithGoTheme(selector) and adm.WithThemeManifest(manifest) after initialization.

Quickstart wires onboarding routes and securelink helpers so hosts can opt in with minimal setup.

Feature gate keys (system scope) used by onboarding flows:

  • users.invite
  • users.password_reset
  • users.signup

Enable these via gate defaults (for example WithFeatureDefaults) or runtime overrides. Alias policy: users.self_registration is not supported; use users.signup.

Securelink config defaults:

  • quickstart.DefaultSecureLinkConfig(basePath) returns:
  • SigningKey="" (manager disabled until a key is provided)
  • BaseURL="http://localhost:8080"
  • QueryKey="token"
  • AsQuery=true
  • Expiration=72h

Route helpers:

  • RegisterOnboardingRoutes (API endpoints under /admin/api/onboarding by default)
  • RegisterAuthUIRoutes + RegisterRegistrationUIRoutes (UI pages)

See docs/GUIDE_ONBOARDING.md for token lifecycle details, error response shape, and override hook examples.

User migrations

Quickstart registers the combined profile by default (go-auth -> go-users):

if err := quickstart.RegisterUserMigrations(client); err != nil {
	return err
}

Canonical profiles:

  • quickstart.UserMigrationsProfileAuthOnly -> go-auth
  • quickstart.UserMigrationsProfileCombined -> go-auth -> go-users
  • quickstart.UserMigrationsProfileUsersStandalone -> go-users-auth -> go-users-auth-extras -> go-users

Canonical source labels:

  • quickstart.UserMigrationsSourceLabelAuth
  • quickstart.UserMigrationsSourceLabelUsersCore
  • quickstart.UserMigrationsSourceLabelUsersAuthBootstrap
  • quickstart.UserMigrationsSourceLabelUsersAuthExtras

Example: register users standalone mode (no go-auth migrations):

if err := quickstart.RegisterUserMigrations(
	client,
	quickstart.WithUserMigrationsProfile(quickstart.UserMigrationsProfileUsersStandalone),
); err != nil {
	return err
}

Services module migration registration uses services-stack (go-auth -> go-users -> go-services -> app-local) by default via modules/services.RegisterServiceMigrations.

Static assets (opt-in disk fallback)

diskAssetsDir := quickstart.ResolveDiskAssetsDir(
	"output.css",
	"path/to/pkg/client/assets",
	"assets",
)
quickstart.NewStaticAssets(r, cfg, client.Assets(), quickstart.WithDiskAssetsDir(diskAssetsDir))

Usage example

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en")
exportBundle := quickstart.NewExportBundle()
adm, adapters, err := quickstart.NewAdmin(cfg, quickstart.AdapterHooks{
	PersistentCMS: func(ctx context.Context, defaultLocale string) (admin.CMSOptions, string, error) {
		return admin.CMSOptions{}, "in-memory CMS", nil
	},
}, quickstart.WithAdminDependencies(admin.Dependencies{
	ExportRegistry:  exportBundle.Registry,
	ExportRegistrar: exportBundle.Registrar,
	ExportMetadata:  exportBundle.Metadata,
}))
if err != nil {
	return err
}

// Register definitions and row sources on exportBundle.Runner.
// exportBundle.Runner.Definitions.Register(...)
// exportBundle.Runner.RowSources.Register(...)

views, err := quickstart.NewViewEngine(os.DirFS("./web"))
if err != nil {
	return err
}

srv, r := quickstart.NewFiberServer(views, cfg, adm, true)
quickstart.NewStaticAssets(r, cfg, os.DirFS("./web"))
_ = quickstart.NewModuleRegistrar(adm, cfg, []admin.Module{}, true)

_ = adapters
_ = srv
cfg := quickstart.NewAdminConfig(
	"/admin",
	"Admin",
	"en",
)
flags := config.Admin.AdapterFlags
adm, adapters, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithAdapterFlags(flags),
	quickstart.WithFeatureDefaults(quickstart.DefaultMinimalFeatures()),
)
if err != nil {
	return err
}
_ = adapters
_ = adm
err = quickstart.NewModuleRegistrar(
	adm,
	cfg,
	modules,
	isDev,
)
if err != nil {
	return err
}
authn, authz := quickstart.WithGoAuth(
	adm,
	routeAuth,
	authConfig,
	admin.GoAuthAuthorizerConfig{DefaultResource: "admin"},
	&admin.AuthConfig{
		LoginPath:    "/admin/login",
		LogoutPath:   "/admin/logout",
		RedirectPath: "/admin",
	},
)
_ = authn
_ = authz
if err := quickstart.WithDefaultDashboardRenderer(adm, views, cfg); err != nil {
	return err
}
formgen, err := quickstart.NewFormGenerator(os.DirFS("./openapi"), os.DirFS("./forms"))
if err != nil {
	return err
}
_ = formgen
registry := components.New()
registry.MustRegister("permission-matrix", components.Descriptor{
	Renderer: permissionMatrixRenderer,
})

formgen, err := quickstart.NewFormGenerator(
	os.DirFS("./openapi"),
	os.DirFS("./forms"),
	quickstart.WithComponentRegistryMergeDefaults(registry),
	quickstart.WithVanillaOption(formgenvanilla.WithStylesheet("/admin/assets/forms.css")),
)
if err != nil {
	return err
}
_ = formgen

WithVanillaOption(...) is applied last, so it can override templates/styles/registry. Use WithComponentRegistry(...) instead of the merge option to replace defaults entirely.

Debug quickstart

Debug is opt-in and requires module registration plus middleware/log wiring. Configure panels before constructing the admin; attach middleware/log helpers after the debug module is registered so the collector is available.

Use explicit option structs:

  • quickstart.WithDebugOptions(quickstart.DebugOption{...}) for debug fields.
  • quickstart.WithErrorOptions(quickstart.ErrorOption{...}) for error presentation fields.
  • quickstart.WithDebugFromEnv(...) / quickstart.WithErrorsFromEnv(...) remain compatibility shims and no longer read process environment.
cfg := quickstart.NewAdminConfig(
	"/admin",
	"Admin",
	"en",
	quickstart.WithDebugOptions(quickstart.DebugOption{
		Enabled:     admin.BoolPtr(true),
		LayoutMode:  "admin",
		ReplEnabled: admin.BoolPtr(true),
	}),
	quickstart.WithErrorOptions(quickstart.ErrorOption{
		DevMode:               admin.BoolPtr(true),
		IncludeStackTrace:     admin.BoolPtr(true),
		ExposeInternalMessage: admin.BoolPtr(true),
	}),
)

quickstart.ConfigureDebugPanels(&cfg, quickstart.DebugPanelDeps{}, quickstart.DefaultDebugPanelCatalog())

adm, _, err := quickstart.NewAdmin(cfg, hooks, quickstart.WithAdminDependencies(deps))
if err != nil {
	return err
}

modules := []admin.Module{
	// core modules...
}
if cfg.Debug.Enabled {
	modules = append(modules, admin.NewDebugModule(cfg.Debug))
}

if err := quickstart.NewModuleRegistrar(
	adm,
	cfg,
	modules,
	isDev,
); err != nil {
	return err
}

if cfg.Debug.Enabled {
	quickstart.AttachDebugMiddleware(r, cfg, adm)
	quickstart.AttachDebugLogHandler(cfg, adm)
}

repoOptions := adm.DebugQueryHookOptions()
repo := repository.MustNewRepositoryWithOptions[*MyModel](db, handlers, repoOptions...)
Scope debug (optional)

Scope debug captures the raw/resolved tenant/org scope for requests, adds an X-Admin-Resolved-Scope header, and exposes a JSON snapshot endpoint.

Scope debug is explicit:

  • choose whether scope capture is enabled in your host config
  • set a ring buffer size (default 200)
scopeDebugEnabled := true
var scopeDebugBuffer *quickstart.ScopeDebugBuffer
if scopeDebugEnabled {
	scopeDebugBuffer = quickstart.NewScopeDebugBuffer(200)
}

quickstart.ConfigureDebugPanels(
	&cfg,
	quickstart.DebugPanelDeps{ScopeBuffer: scopeDebugBuffer},
	quickstart.DefaultDebugPanelCatalog(),
)

wrapAuthed := authn.WrapHandler
if scopeDebugEnabled {
	wrapAuthed = quickstart.ScopeDebugWrap(authn, &cfg, scopeDebugBuffer)
}

r.Get(path.Join(cfg.BasePath, "api", "debug", "scope"), wrapAuthed(quickstart.ScopeDebugHandler(scopeDebugBuffer)))

Preferences quickstart

  • FeaturePreferences remains opt-in: pass EnablePreferences() or supply WithFeatureDefaults(map[string]bool{"preferences": true}) when building the admin gate.
  • A 403 on /admin/api/panels/preferences usually means the default permissions are missing (admin.preferences.view, admin.preferences.edit).
  • Read query params: levels, keys, include_traces, include_versions, tenant_id, org_id.
  • Clear/delete semantics: send clear_raw_keys or clear: true (for all raw keys), plus empty values for known keys to delete user-level overrides.
  • Non-user writes (tenant/org/system) require admin.preferences.manage_tenant, admin.preferences.manage_org, admin.preferences.manage_system.
  • Dashboard preferences endpoints default to preferences permissions; override with cfg.DashboardPreferencesPermission / cfg.DashboardPreferencesUpdatePermission if needed.
  • See ../docs/GUIDE_MOD_PREFERENCES.md for module behavior, traces, and clear semantics.
  • If you want quickstart to build the repo (for example, to enable caching), pass WithGoUsersPreferencesRepositoryFactory to NewAdmin.
  • Use NewPreferencesModule with WithPreferencesSchemaPath to override the form schema (file path or a directory containing schema.json).
  • Use WithPreferencesJSONEditorStrict(true) to enforce client-side JSON validation of raw_ui (default is lenient; server-side validation still applies).
prefsStore, err := quickstart.NewGoUsersPreferencesStore(preferenceRepo)
if err != nil {
	return err
}

adm, err := admin.New(cfg, admin.Dependencies{
	PreferencesStore: prefsStore,
})
if err != nil {
	return err
}
_ = adm
adm, _, err := quickstart.NewAdmin(
	cfg,
	adapterHooks,
	quickstart.WithGoUsersPreferencesRepositoryFactory(func() (types.PreferenceRepository, error) {
		return preferences.NewRepository(
			preferences.RepositoryConfig{DB: client.DB()},
			preferences.WithCache(true),
		)
	}),
	quickstart.EnablePreferences(),
)
if err != nil {
	return err
}
_ = adm
err := quickstart.RegisterPreferencesPermissions(func(def quickstart.PermissionDefinition) error {
	return permissions.Register(def.Key, def.Description)
})
if err != nil {
	return err
}
modules := []admin.Module{
	quickstart.NewPreferencesModule(
		cfg,
		"",
		quickstart.WithPreferencesSchemaPath("./configs/preferences"),
		quickstart.WithPreferencesJSONEditorStrict(true),
	),
}
if err := quickstart.NewModuleRegistrar(adm, cfg, modules, isDev); err != nil {
	return err
}

Stage 1 minimal flow

  • Build config with NewAdminConfig(...) and pass WithFeatureDefaults(DefaultMinimalFeatures()) to NewAdmin.
  • Resolve adapter flags from config and pass via WithAdapterFlags(...).
  • Register modules with NewModuleRegistrar (uses adm.FeatureGate() by default).
  • Wire auth with WithGoAuth(...) (include *admin.AuthConfig when needed).
  • Enable dashboard SSR with WithDefaultDashboardRenderer(...) (override templates as needed).

Translation Profile Operational Runbook

Config-based Configuration

Configure translation profiles via WithTranslationProductConfig(...):

Field Values Default Description
Profile none, core, core+exchange, core+queue, full Empty (resolves to core when CMS enabled) Sets the baseline translation capability profile
Exchange.Enabled true, false Profile default Overrides exchange module enablement
Queue.Enabled true, false Profile default Overrides queue module enablement

Profile capability matrix:

Profile Exchange Queue Use Case
none - - Translation disabled
core - - Basic translation readiness only
core+exchange Yes - Import/export workflows
core+queue - Yes Assignment management
full Yes Yes Complete translation operations
Verification Checklist
  1. Start the host app with the intended profile and overrides.
  2. Validate the startup capability event and module flags.
  3. Validate module route exposure for enabled modules.
  4. Validate disabled modules are not exposed.

Example startup:

adm, _, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithTranslationProductConfig(quickstart.TranslationProductConfig{
		SchemaVersion: quickstart.TranslationProductSchemaVersionCurrent,
		Profile:       quickstart.TranslationProfileFull,
		Exchange:      &quickstart.TranslationExchangeConfig{Enabled: true},
		Queue:         &quickstart.TranslationQueueConfig{Enabled: true},
	}),
)
if err != nil {
	return err
}

Check startup logs for translation.capabilities.startup and verify:

  • profile is the expected resolved value.
  • modules.exchange.enabled and modules.queue.enabled match the final intended state.
  • routes includes enabled module routes only.
  • resolver_keys include route keys expected by UI entrypoints.
Route/Capability Expectations

Expected runtime routes when modules are enabled:

  • Exchange UI route: /admin/translations/exchange
  • Queue UI route: /admin/content/translations
  • Exchange API routes: /admin/api/translations/export, /admin/api/translations/import/validate, /admin/api/translations/import/apply
  • Queue panel API route: /admin/api/panels/translations

When a module is disabled:

  • Exchange UI route is not registered.
  • Exchange API endpoints are not registered.
  • Queue panel/API routes are not registered.
  • Capability metadata (TranslationCapabilities(adm)) reports the module as disabled.
Troubleshooting
Symptom Likely Cause Resolution
translation product config invalid at startup Missing CMS feature for non-none profile Enable cms feature or use profile none
Exchange routes not registered Exchange module not enabled Set TranslationProductConfig.Exchange.Enabled=true or use core+exchange/full profile
exchange.handlers_missing error Exchange store not configured Provide TranslationExchangeConfig.Store implementation
queue.locales_invalid error Queue enabled without supported locales Set TranslationQueueConfig.SupportedLocales or configure translation policy
Translation UI not visible Feature gate disabled Check FeatureTranslationExchange in feature gate
Runtime Validation

After admin initialization, call quickstart.TranslationCapabilities(adm) to get resolved capabilities:

caps := quickstart.TranslationCapabilities(adm)
log.Printf("Translation profile: %s", caps["profile"])
log.Printf("Exchange enabled: %v", caps["modules"].(map[string]any)["exchange"].(map[string]any)["enabled"])
log.Printf("Registered routes: %v", caps["routes"])

References

  • ../QUICKBOOT_TDD.md
  • ../QUICKBOOT_TSK.md

Compatibility note

If you previously imported quickstart as part of the root module, keep the same import path but add a direct require on github.com/goliatone/go-admin/quickstart in your go.mod (or use a local replace/go.work entry during dev). The APIs are unchanged; only the module boundary moved.

What’s included

  • Navigation: slug-derived menu IDs/lookup, parent scaffolder for grouped/collapsible defaults, canonical content-parent permission helper (DefaultContentParentPermissions), idempotent seeding (SeedNavigation), deterministic ordering, permission filtering, collapsible state, and view helpers (WithNav, BuildNavItems).
  • Sidebar: embedded templates/partials and assets (CSS/JS) with collapse + submenu persistence; apps can override by adding their own template/assets FS ahead of the defaults.
  • Error handling: Fiber error handler that returns JSON for API paths and renders the branded error page (with nav/theme/session) for HTML routes.
  • Adapters: explicit AdapterFlags wiring for persistent CMS, go-options settings, and go-users activity sink with safe in-memory fallbacks.
  • Auth debug: GoAuthAuthorizer supports explicit config debug mode for structured decision logging (logger injectable).

Adapter and runtime toggles

  • Set adapter switches with quickstart.WithAdapterFlags(quickstart.AdapterFlags{...}).
  • For navigation reset/debug behavior, pass explicit host runtime config to your setup layer (for example examples/web/setup.ConfigureRuntime(...)).
  • For authz diagnostics, set admin.GoAuthAuthorizerConfig.Debug explicitly when constructing the authorizer.

Overrides

  • Templates/Assets: prepend your own FS via WithViewTemplatesFS/WithViewAssetsFS to override the embedded sidebar.
  • Navigation seed: pass custom items to SeedNavigation; module menu contributions are deduped by ID.
  • Module gating: WithModuleFeatureGates(customGate) with optional WithModuleFeatureDisabledHandler.
  • Translation nav seeding: WithTranslationCapabilityMenuMode(TranslationCapabilityMenuModeTools) adds dashboard/queue/exchange links into a dedicated Translations menu group in server-seeded navigation.
  • Dashboard SSR: provide WithDashboardTemplatesFS and/or disable embedded templates via WithDashboardEmbeddedTemplates(false).
  • Dashboard widget contract: handlers should return typed admin.WidgetPayload models consumed by both SSR and client hydration; avoid render-mode payload branching and disallow chart_html/full-document/script blobs in payload data.
  • Error handler: swap quickstart.NewFiberErrorHandler with your own if needed.

Documentation

Index

Constants

View Source
const (
	// SidebarPlacementPrimary is the placement key used for the main sidebar tree.
	SidebarPlacementPrimary = "sidebar"
	// SidebarPlacementUtility is the placement key used for fixed utility links above the user pod.
	SidebarPlacementUtility = "sidebar_utility"
	// FooterPlacement is the placement key used for footer navigation.
	FooterPlacement = "footer"

	// NavigationGroupMainID is the canonical main navigation group parent ID.
	NavigationGroupMainID = "nav-group-main"
	// NavigationSectionContentID is the canonical content section parent ID.
	NavigationSectionContentID = NavigationGroupMainID + ".content"
	// NavigationGroupToolsID is the canonical Tools group parent ID.
	NavigationGroupToolsID = "nav-group-others"
	// NavigationGroupOthersID is retained as an alias for backward compatibility.
	NavigationGroupOthersID = NavigationGroupToolsID
	// NavigationGroupTranslationsID is the canonical Translations group parent ID.
	NavigationGroupTranslationsID = "nav-group-translations"

	// DefaultSidebarUtilityMenuCode is the default menu code used for sidebar utility links.
	DefaultSidebarUtilityMenuCode = "admin.utility"
)
View Source
const (
	ScopeDebugPanelID = "scope"
	ScopeDebugHeader  = "X-Admin-Resolved-Scope"
)
View Source
const (
	UserMigrationsSourceLabelAuth               = "go-auth"
	UserMigrationsSourceLabelUsersCore          = "go-users"
	UserMigrationsSourceLabelUsersAuthBootstrap = "go-users-auth"
	UserMigrationsSourceLabelUsersAuthExtras    = "go-users-auth-extras"
)

User migration source labels for dialect-aware registration.

View Source
const (
	UserRoleBulkAssignRouteKey   = "users.bulk.assign_role"
	UserRoleBulkUnassignRouteKey = "users.bulk.unassign_role"
)
View Source
const DefaultNavMenuCode = "admin_main"

DefaultNavMenuCode is the quickstart default menu identifier.

View Source
const TranslationProductSchemaVersionCurrent = 1

TranslationProductSchemaVersionCurrent is the supported quickstart product schema version.

View Source
const TranslationProductSchemaVersionMinimumSupported = 0

TranslationProductSchemaVersionMinimumSupported is the minimum schema version accepted for deterministic up-conversion into the current version.

View Source
const WorkflowConfigSchemaVersionCurrent = 1

WorkflowConfigSchemaVersionCurrent is the current schema version for external workflow config.

View Source
const WorkflowConfigSchemaVersionMinimumSupported = 0

WorkflowConfigSchemaVersionMinimumSupported is the oldest accepted schema version.

Variables

View Source
var (
	// ErrBinaryObjectContextRequired signals a missing response context.
	ErrBinaryObjectContextRequired = errors.New("quickstart: response context required")
	// ErrBinaryObjectStoreRequired signals a missing object store.
	ErrBinaryObjectStoreRequired = errors.New("quickstart: object store is not configured")
	// ErrBinaryObjectKeyRequired signals a missing object key.
	ErrBinaryObjectKeyRequired = errors.New("quickstart: object key is required")
	// ErrBinaryObjectUnavailable signals a missing/empty object payload.
	ErrBinaryObjectUnavailable = errors.New("quickstart: object payload is unavailable")
)
View Source
var ErrGoUsersUserManagementConfig = errors.New("go-users user management config invalid")
View Source
var ErrPersistentCMSSetupFailed = errors.New("quickstart: persistent CMS setup failed")
View Source
var ErrTranslationExchangeConfig = errors.New("translation exchange config invalid")

ErrTranslationExchangeConfig indicates invalid quickstart exchange wiring.

View Source
var ErrTranslationProductConfig = errors.New("translation product config invalid")

ErrTranslationProductConfig indicates invalid translation product profile wiring.

View Source
var ErrTranslationQueueConfig = errors.New("translation queue config invalid")

ErrTranslationQueueConfig indicates invalid quickstart queue wiring.

View Source
var ErrWorkflowConfig = errors.New("workflow config invalid")

ErrWorkflowConfig indicates workflow config parsing/normalization issues.

Functions

func AddDebugPanels added in v0.24.0

func AddDebugPanels(cfg *admin.Config, panels ...string)

AddDebugPanels appends panels to the debug config, preserving defaults.

func ApplyAdapterIntegrations

func ApplyAdapterIntegrations(adm *admin.Admin, result *AdapterResult, hooks AdapterHooks)

ApplyAdapterIntegrations wires optional adapters post-admin initialization.

func ApplyScopeConfig added in v0.24.0

func ApplyScopeConfig(cfg *admin.Config, scope ScopeConfig)

ApplyScopeConfig writes scope defaults back into admin.Config.

func ApplyScopeDefaultsToMetadata added in v0.24.0

func ApplyScopeDefaultsToMetadata(metadata map[string]any, cfg admin.Config) map[string]any

ApplyScopeDefaultsToMetadata injects default tenant/org metadata when enabled.

func ApplySecureLinkManager added in v0.19.0

func ApplySecureLinkManager(cfg *userssvc.Config, manager userstypes.SecureLinkManager, opts ...SecureLinkUsersOption)

ApplySecureLinkManager wires securelink settings into go-users config.

func ApplySecureLinkManagerToAuth added in v0.19.0

func ApplySecureLinkManagerToAuth(target SecureLinkManagerSetter, manager userstypes.SecureLinkManager)

ApplySecureLinkManagerToAuth wires the securelink manager into go-auth style handlers.

func AttachDebugLogHandler added in v0.15.0

func AttachDebugLogHandler(cfg admin.Config, adm *admin.Admin)

AttachDebugLogHandler wires slog to the debug collector when CaptureLogs is enabled.

func AttachDebugMiddleware added in v0.15.0

func AttachDebugMiddleware[T any](r router.Router[T], cfg admin.Config, adm *admin.Admin)

AttachDebugMiddleware registers the debug request capture middleware on the router.

func AttachGoAuthActivitySink added in v0.19.0

func AttachGoAuthActivitySink(auther *auth.Auther, sink admin.ActivitySink, opts ...GoAuthActivitySinkOption)

AttachGoAuthActivitySink wires the go-auth activity adapter into the auther.

func AuthUIViewContext added in v0.19.0

func AuthUIViewContext(cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext

AuthUIViewContext builds a view context with auth flags + paths.

func BuildNavItems

func BuildNavItems(adm *admin.Admin, cfg admin.Config, ctx context.Context, active string) []map[string]any

BuildNavItems builds navigation menu items from the admin menu service.

func BuildNavItemsForPlacement

func BuildNavItemsForPlacement(adm *admin.Admin, cfg admin.Config, placements PlacementConfig, placement string, ctx context.Context, active string) []map[string]any

BuildNavItemsForPlacement resolves a menu for a placement and returns render-ready entries.

func BuildPanelDataGridConfig added in v0.25.0

func BuildPanelDataGridConfig(opts PanelDataGridConfigOptions) map[string]any

BuildPanelDataGridConfig resolves datagrid_config for datatable templates.

func BuildPanelExportConfig added in v0.25.0

func BuildPanelExportConfig(cfg admin.Config, opts PanelViewCapabilityOptions) map[string]any

BuildPanelExportConfig resolves export_config for datatable templates.

func BuildPanelViewCapabilities added in v0.25.0

func BuildPanelViewCapabilities(cfg admin.Config, opts PanelViewCapabilityOptions) router.ViewContext

BuildPanelViewCapabilities returns standard capability keys for panel templates.

Current keys: - export_config - datagrid_config

func ConfigureDebugPanels added in v0.24.0

func ConfigureDebugPanels(cfg *admin.Config, deps DebugPanelDeps, catalog DebugPanelCatalog)

ConfigureDebugPanels ensures debug panels are enabled in config and registered in the catalog.

func ConfigureExportRenderers added in v0.13.0

func ConfigureExportRenderers(bundle *ExportBundle, templatesFS fs.FS, opts ...ExportTemplateOption) error

ConfigureExportRenderers registers template + PDF renderers using the provided templates FS.

func DashboardTemplatesFS

func DashboardTemplatesFS() fs.FS

DashboardTemplatesFS returns the embedded dashboard templates filesystem.

func DebugWSAuthMiddleware added in v0.24.0

func DebugWSAuthMiddleware(auther *auth.Auther, cfg admin.DebugConfig, config ...router.WSAuthConfig) router.WebSocketMiddleware

DebugWSAuthMiddleware returns a go-auth backed WebSocket auth middleware with defaults aligned to debug remote settings.

func DefaultAdminFeatures

func DefaultAdminFeatures() map[string]bool

DefaultAdminFeatures returns the baseline feature defaults for quickstart.

func DefaultContentParentPermissions added in v0.25.0

func DefaultContentParentPermissions() []string

DefaultContentParentPermissions returns the canonical permission set used for the sidebar "Content" parent node.

func DefaultContentTypePreviewFallback added in v0.24.0

func DefaultContentTypePreviewFallback() admin.SchemaPreviewFallback

DefaultContentTypePreviewFallback returns the standard preview error HTML.

func DefaultMenuParents

func DefaultMenuParents(menuCode string) []admin.MenuItem

DefaultMenuParents returns the baseline parents/groups used by quickstart modules.

func DefaultMinimalFeatures

func DefaultMinimalFeatures() map[string]bool

DefaultMinimalFeatures returns a Stage 1 friendly feature default set.

func DefaultScopeFilter added in v0.24.0

func DefaultScopeFilter(cfg admin.Config) userstypes.ScopeFilter

DefaultScopeFilter returns the default scope for single-tenant mode.

func DefaultSecureLinkRoutes added in v0.19.0

func DefaultSecureLinkRoutes(basePath string) map[string]string

DefaultSecureLinkRoutes builds the route map used by securelink managers.

func DefaultTemplateFuncs

func DefaultTemplateFuncs(opts ...TemplateFuncOption) map[string]any

DefaultTemplateFuncs returns shared template functions for view rendering.

func DefaultThemeTokens

func DefaultThemeTokens() map[string]string

DefaultThemeTokens returns the baseline theme tokens used by quickstart.

func EnsureDefaultMenuParents

func EnsureDefaultMenuParents(ctx context.Context, menuSvc admin.CMSMenuService, menuCode, locale string) error

EnsureDefaultMenuParents scaffolds the default parents so module menus can nest without seeds.

func IconRendererFunc added in v0.25.0

func IconRendererFunc(renderer TemplateIconRenderer) func(ref string, variant string) string

IconRendererFunc creates a template-compatible render function from a TemplateIconRenderer. Template-driven values are treated as untrusted by default.

func MergeComponentDescriptors

func MergeComponentDescriptors(base, override components.Descriptor) components.Descriptor

MergeComponentDescriptors combines a default descriptor with an override. Renderer uses the override when provided; assets are appended.

func MergeTemplateFuncs

func MergeTemplateFuncs(overrides map[string]any, opts ...TemplateFuncOption) map[string]any

MergeTemplateFuncs combines default functions with caller overrides.

func NewActivityModule added in v0.25.0

func NewActivityModule(opts ...ActivityModuleOption) *admin.ActivityModule

NewActivityModule returns the built-in activity module under the quickstart Tools group.

func NewAdminConfig

func NewAdminConfig(basePath, title, defaultLocale string, opts ...AdminConfigOption) admin.Config

NewAdminConfig builds a baseline admin config with quickstart defaults.

func NewCompositeActivitySink

func NewCompositeActivitySink(primary admin.ActivitySink, hooks dashboardactivity.Hooks, cfg dashboardactivity.Config) admin.ActivitySink

NewCompositeActivitySink forwards admin activity entries to the primary sink and dashboard hooks.

func NewContentTypeBuilderModule added in v0.24.0

func NewContentTypeBuilderModule(cfg admin.Config, menuParent string, opts ...admin.ContentTypeBuilderOption) admin.Module

NewContentTypeBuilderModule builds a content type builder module with quickstart defaults.

func NewDashboardTemplateRenderer added in v0.25.0

func NewDashboardTemplateRenderer(opts ...DashboardRendererOption) (admin.DashboardRenderer, error)

NewDashboardTemplateRenderer builds the default dashboard SSR renderer.

func NewDebugModule added in v0.25.0

func NewDebugModule(cfg admin.DebugConfig, opts ...DebugModuleOption) *admin.DebugModule

NewDebugModule returns the built-in debug module under the quickstart Tools group.

func NewFeatureFlagsModule added in v0.25.0

func NewFeatureFlagsModule(opts ...FeatureFlagsModuleOption) *admin.FeatureFlagsModule

NewFeatureFlagsModule returns the built-in feature flags module under the quickstart Tools group.

func NewFiberErrorHandler

func NewFiberErrorHandler(adm *admin.Admin, cfg admin.Config, isDev bool, opts ...FiberErrorHandlerOption) fiber.ErrorHandler

NewFiberErrorHandler returns a default error handler that renders JSON for API paths and an HTML error page (with nav + theme) for non-API paths.

func NewFiberServer

func NewFiberServer(viewEngine fiber.Views, cfg admin.Config, adm *admin.Admin, isDev bool, opts ...FiberServerOption) (router.Server[*fiber.App], router.Router[*fiber.App])

NewFiberServer constructs a Fiber-backed router adapter with quickstart defaults.

func NewFormGenerator

func NewFormGenerator(openapiFS fs.FS, templatesFS fs.FS, opts ...FormGeneratorOption) (*formgenorchestrator.Orchestrator, error)

NewFormGenerator creates a form generator from OpenAPI and template filesystems.

func NewGoAuthActivitySink added in v0.19.0

func NewGoAuthActivitySink(sink admin.ActivitySink, opts ...GoAuthActivitySinkOption) auth.ActivitySink

NewGoAuthActivitySink adapts go-auth activity events into the admin activity sink.

func NewModuleRegistrar

func NewModuleRegistrar(adm *admin.Admin, cfg admin.Config, modules []admin.Module, isDev bool, opts ...ModuleRegistrarOption) error

NewModuleRegistrar seeds navigation and registers modules deterministically.

func NewNotificationsSecureLinkManager added in v0.19.0

func NewNotificationsSecureLinkManager(cfg SecureLinkConfig) (links.SecureLinkManager, error)

NewNotificationsSecureLinkManager builds a go-notifications compatible securelink manager.

func NewPreferencesModule added in v0.24.0

func NewPreferencesModule(cfg admin.Config, menuParent string, opts ...PreferencesModuleOption) admin.Module

NewPreferencesModule builds a Preferences module with quickstart defaults.

func NewSecureLinkManager added in v0.19.0

func NewSecureLinkManager(cfg SecureLinkConfig) (userstypes.SecureLinkManager, error)

NewSecureLinkManager builds a go-users compatible securelink manager.

func NewSecureLinkNotificationBuilder added in v0.19.0

func NewSecureLinkNotificationBuilder(manager links.SecureLinkManager, opts ...linknotifications.Option) links.LinkBuilder

NewSecureLinkNotificationBuilder builds a securelink link builder for go-notifications.

func NewStaticAssets

func NewStaticAssets[T any](r router.Router[T], cfg admin.Config, assetsFS fs.FS, opts ...StaticAssetsOption)

NewStaticAssets registers static asset routes with quickstart defaults.

func NewThemeSelector

func NewThemeSelector(name, variant string, tokenOverrides map[string]string, opts ...ThemeOption) (theme.Selector, *theme.Manifest, error)

NewThemeSelector registers a default theme manifest and returns a selector.

func NewTranslationPolicy added in v0.24.0

NewTranslationPolicy builds a quickstart translation policy from config + services.

func NewTranslationQueueAutoCreateHook added in v0.25.0

func NewTranslationQueueAutoCreateHook(cfg TranslationQueueConfig) admin.TranslationQueueAutoCreateHook

NewTranslationQueueAutoCreateHook builds an auto-create hook for queue assignments. When enabled, workflow transitions blocked by missing translations will automatically create/reuse queue assignments for the missing locales.

func NewUploadHandler added in v0.25.0

func NewUploadHandler(cfg UploadHandlerConfig) router.HandlerFunc

NewUploadHandler returns a generic multipart upload handler.

func NewUsersModule added in v0.24.0

NewUsersModule returns the built-in user management module with options applied.

func NewViewEngine

func NewViewEngine(baseFS fs.FS, opts ...ViewEngineOption) (fiber.Views, error)

NewViewEngine builds a view engine with quickstart sidebar fallbacks.

func OAuthNeedsReauthorization added in v0.25.0

func OAuthNeedsReauthorization(isExpired, isExpiringSoon, canAutoRefresh bool) bool

OAuthNeedsReauthorization returns true only when manual action is required.

func PathViewContext added in v0.25.0

func PathViewContext(cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext

PathViewContext returns canonical template path keys: - base_path - api_base_path - asset_base_path - preferences_api_path

func RecommendedContentEntryDefaultRenderers added in v0.25.0

func RecommendedContentEntryDefaultRenderers() map[string]string

RecommendedContentEntryDefaultRenderers returns a copy of the recommended default renderer map used by WithContentEntryRecommendedDefaults.

func RegisterAdminPageRoutes added in v0.24.0

func RegisterAdminPageRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	specs ...AdminPageSpec,
) error

RegisterAdminPageRoutes registers simple admin HTML page routes with URLKit resolution.

func RegisterAdminUIRoutes added in v0.13.0

func RegisterAdminUIRoutes[T any](r router.Router[T], cfg admin.Config, adm *admin.Admin, auth admin.HandlerAuthenticator, opts ...UIRouteOption) error

RegisterAdminUIRoutes registers default UI routes (dashboard + notifications).

func RegisterAuthUIRoutes added in v0.13.0

func RegisterAuthUIRoutes[T any](r router.Router[T], cfg admin.Config, auther *auth.Auther, cookieName string, opts ...AuthUIOption) error

RegisterAuthUIRoutes registers login, logout, and password reset UI routes.

func RegisterContentEntryAliasRoutes added in v0.24.0

func RegisterContentEntryAliasRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentAliasRouteOption,
) error

RegisterContentEntryAliasRoutes registers content entry alias routes for content panels.

func RegisterContentEntryUIRoutes added in v0.24.0

func RegisterContentEntryUIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentEntryUIOption,
) error

RegisterContentEntryUIRoutes registers HTML routes for content entries.

func RegisterContentTypeBuilderAPIRoutes added in v0.24.0

func RegisterContentTypeBuilderAPIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentTypeBuilderAPIOption,
) error

RegisterContentTypeBuilderAPIRoutes registers API helper routes for content types and block definitions.

func RegisterContentTypeBuilderUIRoutes added in v0.24.0

func RegisterContentTypeBuilderUIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentTypeBuilderUIOption,
) error

RegisterContentTypeBuilderUIRoutes registers HTML routes for the content type builder.

func RegisterDebugPanelCatalog added in v0.24.0

func RegisterDebugPanelCatalog(cfg *admin.Config, deps DebugPanelDeps, catalog DebugPanelCatalog)

RegisterDebugPanelCatalog registers panels defined in the provided catalog.

func RegisterOnboardingRoutes added in v0.19.0

func RegisterOnboardingRoutes[T any](r router.Router[T], cfg admin.Config, handlers OnboardingHandlers, opts ...OnboardingRouteOption) error

RegisterOnboardingRoutes registers onboarding API endpoints.

func RegisterPreferencesPermissions

func RegisterPreferencesPermissions(register PermissionRegisterFunc) error

RegisterPreferencesPermissions registers the default preferences permissions.

func RegisterRegistrationUIRoutes added in v0.19.0

func RegisterRegistrationUIRoutes[T any](r router.Router[T], cfg admin.Config, opts ...RegistrationUIOption) error

RegisterRegistrationUIRoutes registers the registration UI route.

func RegisterRolesUIRoutes added in v0.22.0

func RegisterRolesUIRoutes[T any](r router.Router[T], cfg admin.Config, adm *admin.Admin, opts ...RolesUIOption) error

RegisterRolesUIRoutes registers HTML routes for role management.

func RegisterScopeDebugPanel added in v0.24.0

func RegisterScopeDebugPanel(buffer *ScopeDebugBuffer)

RegisterScopeDebugPanel registers the scope debug panel with the registry.

func RegisterSettingsUIRoutes added in v0.24.0

func RegisterSettingsUIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...SettingsUIOption,
) error

RegisterSettingsUIRoutes registers a read-only settings page rendered from templates.

func RegisterTranslationExchangePermissions added in v0.25.0

func RegisterTranslationExchangePermissions(register PermissionRegisterFunc) error

RegisterTranslationExchangePermissions registers translation exchange permissions.

func RegisterTranslationExchangeWiring added in v0.25.0

func RegisterTranslationExchangeWiring(adm *admin.Admin, cfg TranslationExchangeConfig) error

RegisterTranslationExchangeWiring wires commands and optional permission registration.

func RegisterTranslationQueuePermissions added in v0.25.0

func RegisterTranslationQueuePermissions(register PermissionRegisterFunc) error

RegisterTranslationQueuePermissions registers translation queue permissions.

func RegisterTranslationQueueWiring added in v0.25.0

func RegisterTranslationQueueWiring(adm *admin.Admin, cfg TranslationQueueConfig, policyCfg TranslationPolicyConfig, hasPolicyCfg bool) error

RegisterTranslationQueueWiring wires queue panels, commands, and optional permissions.

func RegisterUserMigrations added in v0.19.0

func RegisterUserMigrations(client *persistence.Client, opts ...UserMigrationsOption) error

RegisterUserMigrations registers go-auth and go-users migrations with sensible defaults. By default it registers go-auth migrations plus go-users core migrations.

func RegisterUserRoleBulkRoutes added in v0.22.0

func RegisterUserRoleBulkRoutes(r admin.AdminRouter, cfg admin.Config, adm *admin.Admin) error

RegisterUserRoleBulkRoutes registers bulk assign/unassign endpoints.

func ResolveAdminAPIBasePath added in v0.24.0

func ResolveAdminAPIBasePath(urls urlkit.Resolver, cfg admin.Config, fallbackBase string) string

ResolveAdminAPIBasePath returns the base admin API path using URLKit when available.

func ResolveAdminAPIGroupName added in v0.24.0

func ResolveAdminAPIGroupName(cfg admin.Config) string

ResolveAdminAPIGroupName returns the URLKit group name for admin API routes.

func ResolveAdminBasePath added in v0.24.0

func ResolveAdminBasePath(urls urlkit.Resolver, fallback string) string

ResolveAdminBasePath returns the admin base path using URLKit when available.

func ResolveAdminBaseURL added in v0.24.0

func ResolveAdminBaseURL(urls urlkit.Resolver, fallback string) string

ResolveAdminBaseURL returns the admin base URL using URLKit when available.

func ResolveAdminPanelAPICollectionPath added in v0.25.0

func ResolveAdminPanelAPICollectionPath(urls urlkit.Resolver, cfg admin.Config, fallbackBase, panel string) string

ResolveAdminPanelAPICollectionPath returns the canonical admin API collection path for a panel.

func ResolveAdminPanelAPIDetailPath added in v0.25.0

func ResolveAdminPanelAPIDetailPath(urls urlkit.Resolver, cfg admin.Config, fallbackBase, panel, id string) string

ResolveAdminPanelAPIDetailPath returns the canonical admin API detail path for a panel record.

func ResolveAdminPanelDetailURL added in v0.25.0

func ResolveAdminPanelDetailURL(urls urlkit.Resolver, fallback, panel, id string) string

ResolveAdminPanelDetailURL returns the canonical admin UI detail path for a panel record.

func ResolveAdminPanelEditURL added in v0.25.0

func ResolveAdminPanelEditURL(urls urlkit.Resolver, fallback, panel, id string) string

ResolveAdminPanelEditURL returns the canonical admin UI edit path for a panel record.

func ResolveAdminPanelPreviewURL added in v0.25.0

func ResolveAdminPanelPreviewURL(urls urlkit.Resolver, fallback, panel, id string) string

ResolveAdminPanelPreviewURL returns the canonical admin UI preview path for a panel record.

func ResolveAdminPanelURL added in v0.25.0

func ResolveAdminPanelURL(urls urlkit.Resolver, fallback, panel string) string

ResolveAdminPanelURL returns the canonical admin UI path for a panel.

func ResolveAdminRoutePath added in v0.24.0

func ResolveAdminRoutePath(urls urlkit.Resolver, fallback, route string) string

ResolveAdminRoutePath returns a resolved admin route path using URLKit when available.

func ResolveAdminURL added in v0.24.0

func ResolveAdminURL(urls urlkit.Resolver, fallback, path string) string

ResolveAdminURL prefixes the admin base URL to the provided path.

func ResolveDiskAssetsDir added in v0.13.0

func ResolveDiskAssetsDir(marker string, candidates ...string) string

ResolveDiskAssetsDir returns the first candidate directory that contains the marker file.

func ResolveRequestIP added in v0.26.0

func ResolveRequestIP(c RequestIPContext, opts RequestIPOptions) string

ResolveRequestIP resolves the best-effort client IP for a request context. By default it returns the direct peer IP and ignores forwarded headers.

func ScopeBuilder added in v0.24.0

func ScopeBuilder(cfg admin.Config) func(context.Context) userstypes.ScopeFilter

ScopeBuilder returns a scope resolver that applies defaults for single-tenant mode.

func ScopeDebugHandler added in v0.24.0

func ScopeDebugHandler(buffer *ScopeDebugBuffer) router.HandlerFunc

ScopeDebugHandler returns a handler that serves scope debug snapshots.

func ScopeDebugWrap added in v0.24.0

func ScopeDebugWrap(authn *admin.GoAuthAuthenticator, cfg *admin.Config, buffer *ScopeDebugBuffer) func(router.HandlerFunc) router.HandlerFunc

ScopeDebugWrap captures scope debug info for authenticated requests.

func ScopeFromContext added in v0.24.0

func ScopeFromContext(ctx context.Context) userstypes.ScopeFilter

ScopeFromContext extracts scope from go-auth actor/claims metadata.

func SeedLocalizedNavigation added in v0.26.0

func SeedLocalizedNavigation(ctx context.Context, opts SeedLocalizedNavigationOptions) error

SeedLocalizedNavigation seeds canonical menu IDs and applies locale-specific translations.

This is the preferred package-level API for localized site menus. It prevents locale-specific IDs such as "about.es" by keeping identity stable and attaching locale variants as translations.

func SeedNavigation

func SeedNavigation(ctx context.Context, opts SeedNavigationOptions) error

SeedNavigation seeds a menu using the public admin CMS menu contract.

func SeedWorkflowRuntimeFromConfig added in v0.26.0

func SeedWorkflowRuntimeFromConfig(ctx context.Context, runtime admin.WorkflowRuntime, cfg WorkflowConfig) error

SeedWorkflowRuntimeFromConfig upserts canonical workflow definitions + bindings into a runtime service.

func ServeBinaryObject added in v0.25.0

func ServeBinaryObject(c router.Context, cfg BinaryObjectResponseConfig) error

ServeBinaryObject resolves an object from storage and writes it as an HTTP response body.

func SidebarAssetsFS

func SidebarAssetsFS() fs.FS

SidebarAssetsFS returns the embedded sidebar assets (sidebar.js, sidebar.css).

func SidebarTemplatesFS

func SidebarTemplatesFS() fs.FS

SidebarTemplatesFS returns the embedded sidebar templates (partials/sidebar.html).

func TranslationCapabilities added in v0.25.0

func TranslationCapabilities(adm *admin.Admin) map[string]any

TranslationCapabilities returns a stable translation capability snapshot for the admin instance.

func TranslationCapabilitiesForContext added in v0.25.0

func TranslationCapabilitiesForContext(adm *admin.Admin, reqCtx context.Context) map[string]any

TranslationCapabilitiesForContext returns a translation capability snapshot merged with request-scoped permission and action states.

func ValidateWorkflowConfig added in v0.25.0

func ValidateWorkflowConfig(cfg WorkflowConfig) error

ValidateWorkflowConfig validates external workflow config structure and constraints.

func WithAdminUIViewContext added in v0.24.0

func WithAdminUIViewContext(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, active string, c router.Context) router.ViewContext

WithAdminUIViewContext applies the default admin UI view-context builder.

func WithAuthUIViewContext added in v0.19.0

func WithAuthUIViewContext(ctx router.ViewContext, cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext

WithAuthUIViewContext merges auth flags + paths into an existing view context.

func WithAuthUIViewThemeAssets added in v0.19.0

func WithAuthUIViewThemeAssets(ctx router.ViewContext, assets map[string]string, assetPrefix string) router.ViewContext

WithAuthUIViewThemeAssets merges theme assets into an existing view context. It creates or extends the "theme" map with an "assets" sub-map containing the provided asset paths. If assetPrefix is provided, each asset filename is resolved to a full path by joining with the prefix.

This function does not add query-string theme/variant handling; it only provides static asset paths for auth UI templates.

func WithDefaultDashboardRenderer

func WithDefaultDashboardRenderer(adm *admin.Admin, viewEngine fiber.Views, cfg admin.Config, opts ...DashboardRendererOption) error

WithDefaultDashboardRenderer registers a basic dashboard SSR renderer when none is set.

func WithFallbackFS

func WithFallbackFS(primary fs.FS, fallbacks ...fs.FS) fs.FS

WithFallbackFS builds a MultiFS preferring the primary FS first.

func WithFeatureTemplateContext added in v0.20.0

func WithFeatureTemplateContext(ctx router.ViewContext, reqCtx context.Context, scope any, snapshot any) router.ViewContext

WithFeatureTemplateContext injects feature helper keys into a view context when missing.

func WithGoAuth

WithGoAuth wires go-auth adapters into the admin instance.

func WithNav

func WithNav(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, active string, reqCtx context.Context) router.ViewContext

WithNav adds session, theme, and navigation payload to the view context.

func WithNavPlacements

func WithNavPlacements(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, placements PlacementConfig, placement string, active string, reqCtx context.Context) router.ViewContext

WithNavPlacements is like WithNav but allows selecting a placement-specific menu.

func WithPathViewContext added in v0.25.0

func WithPathViewContext(ctx router.ViewContext, cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext

WithPathViewContext merges canonical template path keys into an existing context.

func WithThemeContext added in v0.13.0

func WithThemeContext(ctx router.ViewContext, adm *admin.Admin, req router.Context) router.ViewContext

WithThemeContext resolves the active theme (with optional query overrides) and adds it to the view context.

func WorkflowBindingsFromConfig added in v0.26.0

func WorkflowBindingsFromConfig(cfg WorkflowConfig) []admin.WorkflowBinding

WorkflowBindingsFromConfig converts runtime binding config into canonical admin workflow bindings.

func WorkflowDefinitionsFromConfig added in v0.25.0

func WorkflowDefinitionsFromConfig(cfg WorkflowConfig) map[string]admin.WorkflowDefinition

WorkflowDefinitionsFromConfig converts workflow config into admin workflow definitions.

func WorkflowTraitDefaultsFromConfig added in v0.25.0

func WorkflowTraitDefaultsFromConfig(cfg WorkflowConfig) map[string]string

WorkflowTraitDefaultsFromConfig returns a cloned trait->workflow default map.

Types

type ActivityModuleOption added in v0.25.0

type ActivityModuleOption func(*admin.ActivityModule)

ActivityModuleOption customizes quickstart activity module defaults.

type AdapterFlags

type AdapterFlags struct {
	UsePersistentCMS   bool
	UseGoOptions       bool
	UseGoUsersActivity bool
}

AdapterFlags captures adapter switches (config or env).

type AdapterHooks

type AdapterHooks struct {
	// PersistentCMS should build CMSOptions when persistent storage is desired.
	// Return backend label (for logging) alongside options.
	PersistentCMS func(ctx context.Context, defaultLocale string) (admin.CMSOptions, string, error)
	// GoOptions should swap settings to go-options backend.
	GoOptions func(adm *admin.Admin) (string, error)
	// GoUsersActivity should build an activity sink backed by go-users (or nil).
	GoUsersActivity func() admin.ActivitySink
}

AdapterHooks supplies host-specific builders for optional adapters.

type AdapterResult

type AdapterResult struct {
	Flags              AdapterFlags
	CMSBackend         string
	SettingsBackend    string
	ActivityBackend    string
	ActivitySink       admin.ActivitySink
	PersistentCMSSet   bool
	PersistentCMSError error
	Config             admin.Config
}

AdapterResult describes applied adapters/backends.

func ConfigureAdapters

func ConfigureAdapters(ctx context.Context, cfg admin.Config, hooks AdapterHooks) (admin.Config, AdapterResult)

ConfigureAdapters mutates the admin config (CMS) using explicit defaults and available hooks.

func ConfigureAdaptersWithFlags

func ConfigureAdaptersWithFlags(ctx context.Context, cfg admin.Config, hooks AdapterHooks, flags AdapterFlags) (admin.Config, AdapterResult)

ConfigureAdaptersWithFlags mutates the admin config (CMS) based on supplied flags.

func NewAdmin

func NewAdmin(cfg admin.Config, hooks AdapterHooks, opts ...AdminOption) (*admin.Admin, AdapterResult, error)

NewAdmin constructs an admin instance with adapter wiring applied.

type AdminConfigOption

type AdminConfigOption func(*admin.Config)

AdminConfigOption mutates the base admin config.

func WithDebugConfig added in v0.15.0

func WithDebugConfig(debugCfg admin.DebugConfig) AdminConfigOption

WithDebugConfig merges a debug config into the admin config.

func WithDebugOptions added in v0.26.0

func WithDebugOptions(opt DebugOption) AdminConfigOption

WithDebugOptions applies explicit debug options into admin config.

func WithDefaultScope added in v0.24.0

func WithDefaultScope(tenantID, orgID string) AdminConfigOption

WithDefaultScope sets the default tenant/org identifiers for single-tenant mode.

func WithErrorConfig added in v0.24.0

func WithErrorConfig(errorCfg admin.ErrorConfig) AdminConfigOption

WithErrorConfig merges an error config into the admin config.

func WithErrorOptions added in v0.26.0

func WithErrorOptions(opt ErrorOption) AdminConfigOption

WithErrorOptions applies explicit error options to the admin config.

func WithFeatureCatalogPath added in v0.22.0

func WithFeatureCatalogPath(path string) AdminConfigOption

WithFeatureCatalogPath sets the feature catalog config file path.

func WithNavDebug added in v0.26.0

func WithNavDebug(enabled bool) AdminConfigOption

WithNavDebug enables/disables navigation debug payloads in view context.

func WithNavDebugLog added in v0.26.0

func WithNavDebugLog(enabled bool) AdminConfigOption

WithNavDebugLog enables/disables navigation debug logging.

func WithNavMenuCode

func WithNavMenuCode(code string) AdminConfigOption

WithNavMenuCode overrides the default navigation menu code.

func WithScopeConfig added in v0.24.0

func WithScopeConfig(scope ScopeConfig) AdminConfigOption

WithScopeConfig applies scope defaults for single/multi tenant behavior.

func WithScopeMode added in v0.24.0

func WithScopeMode(mode ScopeMode) AdminConfigOption

WithScopeMode sets the scope mode (single or multi).

func WithTheme

func WithTheme(name, variant string) AdminConfigOption

WithTheme overrides the base theme name/variant.

func WithThemeAssetPrefix

func WithThemeAssetPrefix(prefix string) AdminConfigOption

WithThemeAssetPrefix sets a default asset prefix used by themes.

func WithThemeTokens

func WithThemeTokens(tokens map[string]string) AdminConfigOption

WithThemeTokens merges custom theme tokens.

type AdminOption

type AdminOption func(*adminOptions)

AdminOption customizes NewAdmin behavior.

func EnableFeature

func EnableFeature(feature admin.FeatureKey) AdminOption

EnableFeature enables a single admin feature key for quickstart.NewAdmin.

func EnablePreferences

func EnablePreferences() AdminOption

EnablePreferences enables the preferences feature gate.

func WithAdapterFlags

func WithAdapterFlags(flags AdapterFlags) AdminOption

WithAdapterFlags overrides env-driven adapter flag resolution.

func WithAdminContext

func WithAdminContext(ctx context.Context) AdminOption

WithAdminContext sets the context used when resolving adapter hooks.

func WithAdminDependencies

func WithAdminDependencies(deps admin.Dependencies) AdminOption

WithAdminDependencies sets the admin dependencies passed to admin.New.

func WithDoctorChecks added in v0.25.0

func WithDoctorChecks(checks ...admin.DoctorCheck) AdminOption

WithDoctorChecks registers app-specific doctor diagnostics checks.

func WithFeatureDefaults added in v0.20.0

func WithFeatureDefaults(defaults map[string]bool) AdminOption

WithFeatureDefaults overrides or extends the feature defaults used to build the gate.

func WithGoUsersPreferencesRepository added in v0.24.0

func WithGoUsersPreferencesRepository(repo types.PreferenceRepository) AdminOption

WithGoUsersPreferencesRepository sets a go-users preference repository to be wrapped into an admin PreferencesStore when preferences dependencies are not already provided.

func WithGoUsersPreferencesRepositoryFactory added in v0.24.0

func WithGoUsersPreferencesRepositoryFactory(factory func() (types.PreferenceRepository, error)) AdminOption

WithGoUsersPreferencesRepositoryFactory sets a lazy go-users preference repository builder.

func WithGoUsersUserManagement added in v0.24.0

func WithGoUsersUserManagement(cfg GoUsersUserManagementConfig) AdminOption

WithGoUsersUserManagement wires go-users repositories into admin dependencies.

func WithStartupPolicy added in v0.25.0

func WithStartupPolicy(policy StartupPolicy) AdminOption

WithStartupPolicy configures module startup validation handling policy.

func WithThemeSelector added in v0.24.0

func WithThemeSelector(selector theme.ThemeSelector, manifest *theme.Manifest) AdminOption

WithThemeSelector wires a go-theme selector + manifest into admin.

func WithTraitWorkflowDefaults added in v0.25.0

func WithTraitWorkflowDefaults(defaults map[string]string) AdminOption

WithTraitWorkflowDefaults sets trait->workflow defaults applied to the admin instance.

func WithTranslationExchangeConfig added in v0.25.0

func WithTranslationExchangeConfig(cfg TranslationExchangeConfig) AdminOption

WithTranslationExchangeConfig configures opt-in translation exchange command/permission wiring.

func WithTranslationLocaleLabels added in v0.25.0

func WithTranslationLocaleLabels(labels map[string]string) AdminOption

WithTranslationLocaleLabels overrides locale labels used by create_translation action payload options.

func WithTranslationPolicyConfig added in v0.24.0

func WithTranslationPolicyConfig(cfg TranslationPolicyConfig) AdminOption

WithTranslationPolicyConfig sets the translation policy config for quickstart defaults.

func WithTranslationPolicyServices added in v0.24.0

func WithTranslationPolicyServices(services TranslationPolicyServices) AdminOption

WithTranslationPolicyServices overrides the translation check services used by the default policy.

func WithTranslationProductConfig added in v0.25.0

func WithTranslationProductConfig(cfg TranslationProductConfig) AdminOption

WithTranslationProductConfig applies productized translation module configuration.

func WithTranslationProfile added in v0.25.0

func WithTranslationProfile(profile TranslationProfile) AdminOption

WithTranslationProfile applies a productized translation profile.

func WithTranslationQueueConfig added in v0.25.0

func WithTranslationQueueConfig(cfg TranslationQueueConfig) AdminOption

WithTranslationQueueConfig configures opt-in translation queue feature and command/panel wiring.

func WithWorkflowConfig added in v0.25.0

func WithWorkflowConfig(cfg WorkflowConfig) AdminOption

WithWorkflowConfig sets external workflow definitions + trait defaults.

func WithWorkflowConfigFile added in v0.25.0

func WithWorkflowConfigFile(path string) AdminOption

WithWorkflowConfigFile loads external workflow definitions + trait defaults from file.

func WithWorkflowRuntime added in v0.25.0

func WithWorkflowRuntime(runtime admin.WorkflowRuntime) AdminOption

WithWorkflowRuntime wires persisted workflow runtime management into admin bootstrap.

type AdminPageSpec added in v0.24.0

type AdminPageSpec struct {
	Route              string
	Path               string
	Template           string
	Title              string
	Active             string
	Feature            string
	Permission         string
	ViewContextBuilder UIViewContextBuilder
	BuildContext       func(router.Context) (router.ViewContext, error)
	Guard              func(router.Context) error
}

AdminPageSpec configures a simple admin HTML page route.

type AsyncRequesterFactory

type AsyncRequesterFactory func(service export.Service, logger export.Logger) exportapi.AsyncRequester

AsyncRequesterFactory builds an async requester after the export service is initialized.

type AuthUIOption added in v0.13.0

type AuthUIOption func(*authUIOptions)

AuthUIOption customizes the auth UI routes.

func WithAuthUIBasePath added in v0.13.0

func WithAuthUIBasePath(basePath string) AuthUIOption

WithAuthUIBasePath overrides the base path used by auth UI routes.

func WithAuthUICookie added in v0.13.0

func WithAuthUICookie(cookie router.Cookie) AuthUIOption

WithAuthUICookie overrides the auth cookie defaults.

func WithAuthUIFeatureGate added in v0.20.0

func WithAuthUIFeatureGate(gate fggate.FeatureGate) AuthUIOption

WithAuthUIFeatureGate sets the feature gate used for default guards.

func WithAuthUILoginPath added in v0.13.0

func WithAuthUILoginPath(route string) AuthUIOption

WithAuthUILoginPath overrides the login route path.

func WithAuthUILoginRedirect added in v0.13.0

func WithAuthUILoginRedirect(route string) AuthUIOption

WithAuthUILoginRedirect overrides the redirect path after login.

func WithAuthUILogoutPath added in v0.13.0

func WithAuthUILogoutPath(route string) AuthUIOption

WithAuthUILogoutPath overrides the logout route path.

func WithAuthUILogoutRedirect added in v0.13.0

func WithAuthUILogoutRedirect(route string) AuthUIOption

WithAuthUILogoutRedirect overrides the redirect path after logout.

func WithAuthUIPasswordResetConfirmPath added in v0.19.0

func WithAuthUIPasswordResetConfirmPath(route string) AuthUIOption

WithAuthUIPasswordResetConfirmPath overrides the password reset confirm route path.

func WithAuthUIPasswordResetConfirmTemplate added in v0.19.0

func WithAuthUIPasswordResetConfirmTemplate(name string) AuthUIOption

WithAuthUIPasswordResetConfirmTemplate overrides the password reset confirm template name.

func WithAuthUIPasswordResetConfirmTitle added in v0.19.0

func WithAuthUIPasswordResetConfirmTitle(title string) AuthUIOption

WithAuthUIPasswordResetConfirmTitle overrides the view title for the confirm reset page.

func WithAuthUIPasswordResetEnabled added in v0.13.0

func WithAuthUIPasswordResetEnabled(fn func(admin.Config) bool) AuthUIOption

WithAuthUIPasswordResetEnabled overrides the password reset feature guard.

func WithAuthUIPasswordResetPath added in v0.13.0

func WithAuthUIPasswordResetPath(route string) AuthUIOption

WithAuthUIPasswordResetPath overrides the password reset route path.

func WithAuthUIRegisterPath added in v0.19.0

func WithAuthUIRegisterPath(route string) AuthUIOption

WithAuthUIRegisterPath overrides the self-registration route path.

func WithAuthUISelfRegistrationEnabled added in v0.19.0

func WithAuthUISelfRegistrationEnabled(fn func(admin.Config) bool) AuthUIOption

WithAuthUISelfRegistrationEnabled overrides the self-registration feature guard.

func WithAuthUITemplates added in v0.13.0

func WithAuthUITemplates(loginTemplate, passwordResetTemplate string) AuthUIOption

WithAuthUITemplates overrides the login and password reset templates.

func WithAuthUIThemeAssets added in v0.19.0

func WithAuthUIThemeAssets(prefix string, assets map[string]string) AuthUIOption

WithAuthUIThemeAssets sets theme assets (logo, favicon, etc.) for auth UI templates. The prefix is prepended to each asset filename to form the full URL path. Assets are exposed in templates as theme.assets.logo, theme.assets.favicon, etc.

func WithAuthUITitles added in v0.13.0

func WithAuthUITitles(loginTitle, passwordResetTitle string) AuthUIOption

WithAuthUITitles overrides the view titles for login and password reset.

func WithAuthUIViewContextBuilder added in v0.13.0

func WithAuthUIViewContextBuilder(builder AuthUIViewContextBuilder) AuthUIOption

WithAuthUIViewContextBuilder overrides the default view context builder.

type AuthUIPaths added in v0.19.0

type AuthUIPaths struct {
	BasePath                 string
	PasswordResetPath        string
	PasswordResetConfirmPath string
	RegisterPath             string
}

AuthUIPaths captures common auth-related route paths for templates.

type AuthUIState added in v0.19.0

type AuthUIState struct {
	PasswordResetEnabled    bool
	SelfRegistrationEnabled bool
}

AuthUIState captures feature-guarded flags used by auth templates.

func AuthUIStateFromGate added in v0.20.0

func AuthUIStateFromGate(ctx context.Context, gate fggate.FeatureGate, scope fggate.ScopeChain) AuthUIState

AuthUIStateFromGate derives auth UI flags from the feature gate.

type AuthUIViewContextBuilder added in v0.13.0

type AuthUIViewContextBuilder func(ctx router.ViewContext, c router.Context) router.ViewContext

AuthUIViewContextBuilder mutates the view context for auth UI routes.

type BinaryObjectResponseConfig added in v0.25.0

type BinaryObjectResponseConfig struct {
	Store        BinaryObjectStore
	ObjectKey    string
	ContentType  string
	Filename     string
	Disposition  string
	CacheControl string
	Pragma       string
	StatusCode   int
	Headers      map[string]string
}

BinaryObjectResponseConfig configures object-backed binary responses.

type BinaryObjectStore added in v0.25.0

type BinaryObjectStore interface {
	GetFile(ctx context.Context, path string) ([]byte, error)
}

BinaryObjectStore resolves raw object bytes by key.

type ContentAliasRouteOption added in v0.24.0

type ContentAliasRouteOption func(*contentAliasRouteOptions)

ContentAliasRouteOption customizes the content entry alias route registration.

func WithContentAliasBasePath added in v0.24.0

func WithContentAliasBasePath(basePath string) ContentAliasRouteOption

WithContentAliasBasePath overrides the base path used to build alias routes.

func WithContentAliasRoutes added in v0.24.0

func WithContentAliasRoutes(aliases ...string) ContentAliasRouteOption

WithContentAliasRoutes overrides the aliases that should be registered.

type ContentEntryUIOption added in v0.24.0

type ContentEntryUIOption func(*contentEntryUIOptions)

ContentEntryUIOption customizes content entry UI routes.

func WithContentEntryDataGridStateStore added in v0.25.0

func WithContentEntryDataGridStateStore(cfg PanelDataGridStateStoreOptions) ContentEntryUIOption

WithContentEntryDataGridStateStore configures DataGrid persisted-state storage for content list templates.

func WithContentEntryDataGridURLState added in v0.25.0

func WithContentEntryDataGridURLState(cfg PanelDataGridURLStateOptions) ContentEntryUIOption

WithContentEntryDataGridURLState configures DataGrid URL-state limits for content list templates.

func WithContentEntryDefaultRenderers added in v0.25.0

func WithContentEntryDefaultRenderers(renderers map[string]string) ContentEntryUIOption

WithContentEntryDefaultRenderers replaces the configured default renderer map. Values are used when ui_schema does not specify a renderer.

func WithContentEntryFormRenderer added in v0.24.0

func WithContentEntryFormRenderer(renderer *admin.FormgenSchemaValidator) ContentEntryUIOption

WithContentEntryFormRenderer overrides the form renderer used for content entry forms.

func WithContentEntryMergeDefaultRenderers added in v0.25.0

func WithContentEntryMergeDefaultRenderers(renderers map[string]string) ContentEntryUIOption

WithContentEntryMergeDefaultRenderers merges renderer defaults into the existing map. Keys in renderers override existing configured values.

func WithContentEntryRecommendedDefaults added in v0.25.0

func WithContentEntryRecommendedDefaults() ContentEntryUIOption

WithContentEntryRecommendedDefaults merges recommended content-entry defaults.

func WithContentEntryTranslationUX added in v0.25.0

func WithContentEntryTranslationUX(enabled bool) ContentEntryUIOption

WithContentEntryTranslationUX enables translation list UX enhancements (grouped/matrix view mode wiring and grouped URL sync) for translation-enabled panels.

func WithContentEntryUIAuthResource added in v0.24.0

func WithContentEntryUIAuthResource(resource string) ContentEntryUIOption

WithContentEntryUIAuthResource overrides the go-auth resource used for checks.

func WithContentEntryUIBasePath added in v0.24.0

func WithContentEntryUIBasePath(basePath string) ContentEntryUIOption

WithContentEntryUIBasePath overrides the base path used to build content entry routes.

func WithContentEntryUIPermission added in v0.24.0

func WithContentEntryUIPermission(permission string) ContentEntryUIOption

WithContentEntryUIPermission sets the permission used for authz checks.

func WithContentEntryUITemplateExists added in v0.25.0

func WithContentEntryUITemplateExists(checker func(name string) bool) ContentEntryUIOption

WithContentEntryUITemplateExists sets a template existence checker used to resolve panel template fallbacks.

func WithContentEntryUITemplateFS added in v0.25.0

func WithContentEntryUITemplateFS(fsys ...fs.FS) ContentEntryUIOption

WithContentEntryUITemplateFS configures deterministic template fallback resolution from filesystem sources.

func WithContentEntryUITemplates added in v0.24.0

func WithContentEntryUITemplates(listTemplate, formTemplate, detailTemplate string) ContentEntryUIOption

WithContentEntryUITemplates overrides template names for content entry routes.

func WithContentEntryUIViewContext added in v0.24.0

func WithContentEntryUIViewContext(builder UIViewContextBuilder) ContentEntryUIOption

WithContentEntryUIViewContext overrides the view context builder for content entry routes.

type ContentTypeBuilderAPIOption added in v0.24.0

type ContentTypeBuilderAPIOption func(*contentTypeBuilderAPIOptions)

ContentTypeBuilderAPIOption customizes content type builder API routes.

func WithContentTypeBuilderAPIAuthResource added in v0.24.0

func WithContentTypeBuilderAPIAuthResource(resource string) ContentTypeBuilderAPIOption

WithContentTypeBuilderAPIAuthResource overrides the go-auth resource used for checks.

func WithContentTypeBuilderAPIBasePath added in v0.24.0

func WithContentTypeBuilderAPIBasePath(basePath string) ContentTypeBuilderAPIOption

WithContentTypeBuilderAPIBasePath overrides the base path used to build API routes.

func WithContentTypeBuilderAPIPermission added in v0.24.0

func WithContentTypeBuilderAPIPermission(permission string) ContentTypeBuilderAPIOption

WithContentTypeBuilderAPIPermission sets the permission used for authz checks.

type ContentTypeBuilderUIOption added in v0.24.0

type ContentTypeBuilderUIOption func(*contentTypeBuilderUIOptions)

ContentTypeBuilderUIOption customizes content type builder UI routes.

func WithContentTypeBuilderUIAuthResource added in v0.24.0

func WithContentTypeBuilderUIAuthResource(resource string) ContentTypeBuilderUIOption

WithContentTypeBuilderUIAuthResource overrides the go-auth resource used for checks.

func WithContentTypeBuilderUIBasePath added in v0.24.0

func WithContentTypeBuilderUIBasePath(basePath string) ContentTypeBuilderUIOption

WithContentTypeBuilderUIBasePath overrides the base path used to build UI routes.

func WithContentTypeBuilderUIPermission added in v0.24.0

func WithContentTypeBuilderUIPermission(permission string) ContentTypeBuilderUIOption

WithContentTypeBuilderUIPermission sets the permission used for authz checks.

func WithContentTypeBuilderUITemplates added in v0.24.0

func WithContentTypeBuilderUITemplates(contentTypes, blockDefinitions string) ContentTypeBuilderUIOption

WithContentTypeBuilderUITemplates overrides template names for UI routes.

func WithContentTypeBuilderUIViewContext added in v0.24.0

func WithContentTypeBuilderUIViewContext(builder UIViewContextBuilder) ContentTypeBuilderUIOption

WithContentTypeBuilderUIViewContext overrides the view context builder for UI routes.

type DashboardRendererOption

type DashboardRendererOption func(*dashboardRendererOptions)

DashboardRendererOption customizes the default dashboard renderer setup.

func WithDashboardEmbeddedTemplates

func WithDashboardEmbeddedTemplates(enabled bool) DashboardRendererOption

WithDashboardEmbeddedTemplates toggles the embedded dashboard templates.

func WithDashboardTemplateFuncOptions added in v0.25.0

func WithDashboardTemplateFuncOptions(options ...TemplateFuncOption) DashboardRendererOption

WithDashboardTemplateFuncOptions configures quickstart.DefaultTemplateFuncs when no explicit template function map is provided.

func WithDashboardTemplateFuncs added in v0.25.0

func WithDashboardTemplateFuncs(funcs map[string]any) DashboardRendererOption

WithDashboardTemplateFuncs overrides template functions used by the dashboard renderer.

func WithDashboardTemplatesFS

func WithDashboardTemplatesFS(fsys fs.FS) DashboardRendererOption

WithDashboardTemplatesFS appends a template filesystem to the renderer.

type DebugModuleOption added in v0.25.0

type DebugModuleOption func(*admin.DebugModule)

DebugModuleOption customizes quickstart debug module defaults.

type DebugOption added in v0.26.0

type DebugOption struct {
	Enabled                    *bool
	AllowedIPs                 []string
	AllowedOrigins             []string
	AppID                      string
	AppName                    string
	Environment                string
	RemoteEnabled              *bool
	TokenTTL                   *time.Duration
	SessionTracking            *bool
	SessionIncludeGlobalPanels *bool
	SessionCookieName          string
	SessionInactivityExpiry    *time.Duration
	CaptureSQL                 *bool
	CaptureLogs                *bool
	CaptureJSErrors            *bool
	CaptureRequestBody         *bool
	ToolbarMode                *bool
	ToolbarPanels              []string
	LayoutMode                 string
	ReplEnabled                *bool
	ReplReadOnly               *bool
}

DebugOption applies explicit debug configuration overrides.

type DebugPanelCatalog added in v0.24.0

type DebugPanelCatalog map[string]DebugPanelRegistrar

DebugPanelCatalog maps panel IDs to registration callbacks.

func DefaultDebugPanelCatalog added in v0.24.0

func DefaultDebugPanelCatalog() DebugPanelCatalog

DefaultDebugPanelCatalog returns the built-in quickstart debug panel catalog.

type DebugPanelDeps added in v0.24.0

type DebugPanelDeps struct {
	ScopeBuffer   *ScopeDebugBuffer
	IsDevelopment *bool
	DoctorEnabled *bool
}

DebugPanelDeps provides optional dependencies for debug panel registration.

type DebugPanelRegistrar added in v0.24.0

type DebugPanelRegistrar func(cfg *admin.Config, deps DebugPanelDeps)

DebugPanelRegistrar registers a debug panel definition.

type ErrorOption added in v0.26.0

type ErrorOption struct {
	DevMode               *bool
	IncludeStackTrace     *bool
	ExposeInternalMessage *bool
}

ErrorOption applies explicit error configuration overrides.

type ExportBundle

type ExportBundle struct {
	Runner    *export.Runner
	Service   export.Service
	Registry  admin.ExportRegistry
	Registrar admin.ExportHTTPRegistrar
	Metadata  admin.ExportMetadataProvider
}

ExportBundle wires go-export integrations for go-admin.

func NewExportBundle

func NewExportBundle(opts ...ExportBundleOption) *ExportBundle

NewExportBundle constructs default go-export wiring for go-admin.

type ExportBundleOption

type ExportBundleOption func(*exportBundleOptions)

ExportBundleOption customizes NewExportBundle behavior.

func WithExportActorProvider

func WithExportActorProvider(provider export.ActorProvider) ExportBundleOption

WithExportActorProvider sets the actor provider for export requests.

func WithExportAsyncInProcess

func WithExportAsyncInProcess(timeout time.Duration) ExportBundleOption

WithExportAsyncInProcess enables in-process async exports using a background goroutine. This is suitable for demos; production should use a job runner/queue.

func WithExportAsyncRequester

func WithExportAsyncRequester(factory AsyncRequesterFactory) ExportBundleOption

WithExportAsyncRequester configures async export requests (for 202 + status/download URLs).

func WithExportBasePath

func WithExportBasePath(path string) ExportBundleOption

WithExportBasePath overrides the default export base path. Provide a full path ("/admin/exports") or a suffix ("exports").

func WithExportDeliveryPolicy

func WithExportDeliveryPolicy(policy export.DeliveryPolicy) ExportBundleOption

WithExportDeliveryPolicy overrides the delivery policy defaults.

func WithExportGuard

func WithExportGuard(guard export.Guard) ExportBundleOption

WithExportGuard sets the go-export guard.

func WithExportHistoryPath

func WithExportHistoryPath(path string) ExportBundleOption

WithExportHistoryPath overrides the history endpoint path.

func WithExportLogger

func WithExportLogger(logger export.Logger) ExportBundleOption

WithExportLogger sets the go-export logger.

func WithExportMaxBufferBytes

func WithExportMaxBufferBytes(maxBytes int64) ExportBundleOption

WithExportMaxBufferBytes sets the max buffer size for sync downloads.

func WithExportPathSuffix

func WithExportPathSuffix(suffix string) ExportBundleOption

WithExportPathSuffix overrides the default base path suffix when no base path is set.

func WithExportQueryRequestDecoder

func WithExportQueryRequestDecoder(decoder exportapi.RequestDecoder) ExportBundleOption

WithExportQueryRequestDecoder overrides the querystring request decoder.

func WithExportRequestDecoder

func WithExportRequestDecoder(decoder exportapi.RequestDecoder) ExportBundleOption

WithExportRequestDecoder overrides the JSON request decoder.

func WithExportStore

func WithExportStore(store export.ArtifactStore) ExportBundleOption

WithExportStore sets the artifact store used by go-export.

func WithExportTracker

func WithExportTracker(tracker export.ProgressTracker) ExportBundleOption

WithExportTracker sets the progress tracker used by go-export.

type ExportPDFConfig added in v0.26.0

type ExportPDFConfig struct {
	Engine            string
	WKHTMLToPDFPath   string
	BrowserPath       string
	Timeout           time.Duration
	PageSize          string
	PrintBackground   bool
	PreferCSSPageSize bool
	Headless          bool
	Args              []string
}

ExportPDFConfig controls default PDF renderer behavior.

func DefaultExportPDFConfig added in v0.26.0

func DefaultExportPDFConfig() ExportPDFConfig

DefaultExportPDFConfig returns baseline PDF settings.

type ExportTemplateOption added in v0.13.0

type ExportTemplateOption func(*exportTemplateOptions)

ExportTemplateOption customizes the default export template renderers.

func WithExportPDFConfig added in v0.26.0

func WithExportPDFConfig(cfg ExportPDFConfig) ExportTemplateOption

WithExportPDFConfig overrides default PDF renderer settings.

func WithExportPDFRenderer added in v0.13.0

func WithExportPDFRenderer(builder func(exporttemplate.Renderer) (exportpdf.Renderer, error)) ExportTemplateOption

WithExportPDFRenderer overrides the default PDF renderer builder.

func WithExportTemplateFuncs added in v0.13.0

func WithExportTemplateFuncs(funcs map[string]any) ExportTemplateOption

WithExportTemplateFuncs sets the template helpers used by the export renderer.

func WithExportTemplateMaxRows added in v0.13.0

func WithExportTemplateMaxRows(rows int) ExportTemplateOption

WithExportTemplateMaxRows overrides the buffered template row limit.

func WithExportTemplateName added in v0.13.0

func WithExportTemplateName(name string) ExportTemplateOption

WithExportTemplateName overrides the default template name ("export").

type FeatureFlagsModuleOption added in v0.25.0

type FeatureFlagsModuleOption func(*admin.FeatureFlagsModule)

FeatureFlagsModuleOption customizes quickstart feature flags module defaults.

type FiberErrorHandlerOption added in v0.19.0

type FiberErrorHandlerOption func(*fiberErrorHandlerOptions)

FiberErrorHandlerOption customizes the quickstart Fiber error handler.

func WithFiberErrorMappers added in v0.19.0

func WithFiberErrorMappers(mappers ...goerrors.ErrorMapper) FiberErrorHandlerOption

WithFiberErrorMappers appends custom error mappers to the defaults.

type FiberRuntimeConfig added in v0.26.0

type FiberRuntimeConfig struct {
	StrictRoutes        *bool
	RouteConflictPolicy string
	PathConflictMode    string
	ReadBufferSize      int
}

FiberRuntimeConfig captures typed runtime overrides for Fiber and router adapter behavior.

type FiberServerOption

type FiberServerOption func(*fiberServerOptions)

FiberServerOption customizes the Fiber server defaults.

func WithFiberAdapterConfig added in v0.24.0

func WithFiberAdapterConfig(mutator func(*router.FiberAdapterConfig)) FiberServerOption

WithFiberAdapterConfig overrides the go-router adapter configuration.

func WithFiberConfig

func WithFiberConfig(mutator func(*fiber.Config)) FiberServerOption

WithFiberConfig overrides the default Fiber config.

func WithFiberErrorHandler

func WithFiberErrorHandler(handler fiber.ErrorHandler) FiberServerOption

WithFiberErrorHandler overrides the default error handler.

func WithFiberLogger

func WithFiberLogger(enabled bool) FiberServerOption

WithFiberLogger toggles the default logger middleware.

func WithFiberMiddleware

func WithFiberMiddleware(handlers ...fiber.Handler) FiberServerOption

WithFiberMiddleware appends middleware to the default stack.

func WithFiberRuntimeConfig added in v0.26.0

func WithFiberRuntimeConfig(runtime FiberRuntimeConfig) FiberServerOption

WithFiberRuntimeConfig applies typed runtime overrides for Fiber defaults.

type FormGeneratorOption

type FormGeneratorOption func(*formGeneratorConfig)

FormGeneratorOption configures the form generator.

func WithComponentRegistry

func WithComponentRegistry(reg *components.Registry) FormGeneratorOption

WithComponentRegistry replaces the default component registry.

func WithComponentRegistryMergeDefaults

func WithComponentRegistryMergeDefaults(reg *components.Registry) FormGeneratorOption

WithComponentRegistryMergeDefaults merges a custom registry into defaults. Custom components override built-ins with the same name.

func WithVanillaOption

func WithVanillaOption(opt formgenvanilla.Option) FormGeneratorOption

WithVanillaOption appends a vanilla renderer option. These are applied last to allow overrides.

type GoAuthActivitySinkOption added in v0.19.0

type GoAuthActivitySinkOption func(*goAuthActivitySinkOptions)

GoAuthActivitySinkOption customizes how go-auth activity events are mapped.

func WithGoAuthActivityChannel added in v0.19.0

func WithGoAuthActivityChannel(channel string) GoAuthActivitySinkOption

WithGoAuthActivityChannel overrides the channel used for go-auth events.

func WithGoAuthActivityObjectType added in v0.19.0

func WithGoAuthActivityObjectType(objectType string) GoAuthActivitySinkOption

WithGoAuthActivityObjectType overrides the object type used for go-auth events.

type GoUsersPreferencesStore

type GoUsersPreferencesStore struct {
	// contains filtered or unexported fields
}

GoUsersPreferencesStore bridges go-users preferences into the admin preferences contract.

func NewGoUsersPreferencesStore

func NewGoUsersPreferencesStore(repo types.PreferenceRepository) (*GoUsersPreferencesStore, error)

NewGoUsersPreferencesStore builds a preferences store backed by go-users.

func (*GoUsersPreferencesStore) Delete

func (*GoUsersPreferencesStore) Resolve

func (*GoUsersPreferencesStore) Upsert

type GoUsersUserManagementConfig added in v0.24.0

type GoUsersUserManagementConfig struct {
	AuthRepo      userstypes.AuthRepository
	InventoryRepo userstypes.UserInventoryRepository
	RoleRegistry  userstypes.RoleRegistry
	ProfileRepo   userstypes.ProfileRepository
	ScopeResolver func(context.Context) userstypes.ScopeFilter
}

GoUsersUserManagementConfig captures go-users adapters used by quickstart user management.

type GoUsersUserManagementConfigError added in v0.24.0

type GoUsersUserManagementConfigError struct {
	Missing []string
}

func (GoUsersUserManagementConfigError) Error added in v0.24.0

func (GoUsersUserManagementConfigError) Unwrap added in v0.24.0

type LegacyLocalizedMenuMigrationOptions added in v0.26.0

type LegacyLocalizedMenuMigrationOptions struct {
	MenuSvc  admin.CMSMenuService
	MenuCode string
	Locales  []string
}

LegacyLocalizedMenuMigrationOptions configures migration from locale-suffixed menu IDs.

type LegacyLocalizedMenuMigrationReport added in v0.26.0

type LegacyLocalizedMenuMigrationReport struct {
	MigratedTranslations int
	DeletedLegacyItems   int
	SkippedLegacyItems   int
	LegacyItemIDs        []string
}

LegacyLocalizedMenuMigrationReport summarizes migration effects.

func MigrateLegacyLocalizedMenuItems added in v0.26.0

MigrateLegacyLocalizedMenuItems folds legacy locale-suffixed item IDs (for example "site_main.about.es") into canonical base IDs by transferring localized translations and then removing the suffix nodes.

type LocalizedMenuItemTranslation added in v0.26.0

type LocalizedMenuItemTranslation struct {
	Locale        string
	Label         string
	LabelKey      string
	GroupTitle    string
	GroupTitleKey string
	URLOverride   string
}

LocalizedMenuItemTranslation captures per-locale display and URL override values.

type LocalizedSeedMenuItem added in v0.26.0

type LocalizedSeedMenuItem struct {
	Item         admin.MenuItem
	Translations []LocalizedMenuItemTranslation
}

LocalizedSeedMenuItem represents one canonical menu item and its localized variants.

type ModuleRegistrarOption

type ModuleRegistrarOption func(*moduleRegistrarOptions)

ModuleRegistrarOption customizes module registration behavior.

func WithDefaultSidebarUtilityItems added in v0.25.0

func WithDefaultSidebarUtilityItems(enabled bool) ModuleRegistrarOption

WithDefaultSidebarUtilityItems toggles quickstart-provided utility links.

func WithModuleFeatureDisabledHandler

func WithModuleFeatureDisabledHandler(handler func(feature, moduleID string) error) ModuleRegistrarOption

WithModuleFeatureDisabledHandler configures how feature-disabled modules are handled.

func WithModuleFeatureGates

func WithModuleFeatureGates(gates fggate.FeatureGate) ModuleRegistrarOption

WithModuleFeatureGates enables feature-gated module filtering.

func WithModuleMenuItems

func WithModuleMenuItems(items ...admin.MenuItem) ModuleRegistrarOption

WithModuleMenuItems appends base menu items before seeding.

func WithModuleRegistrarContext

func WithModuleRegistrarContext(ctx context.Context) ModuleRegistrarOption

WithModuleRegistrarContext sets the context used for navigation seeding.

func WithSeedNavigation

func WithSeedNavigation(enabled bool) ModuleRegistrarOption

WithSeedNavigation toggles navigation seeding.

func WithSeedNavigationOptions

func WithSeedNavigationOptions(mutator func(*SeedNavigationOptions)) ModuleRegistrarOption

WithSeedNavigationOptions mutates the seed options before execution.

func WithSidebarUtilityMenuCode added in v0.25.0

func WithSidebarUtilityMenuCode(menuCode string) ModuleRegistrarOption

WithSidebarUtilityMenuCode overrides the menu code used for utility links.

func WithSidebarUtilityMenuItems added in v0.25.0

func WithSidebarUtilityMenuItems(items ...admin.MenuItem) ModuleRegistrarOption

WithSidebarUtilityMenuItems appends utility links for the fixed sidebar utility zone.

func WithToolsMenuItems added in v0.25.0

func WithToolsMenuItems(items ...admin.MenuItem) ModuleRegistrarOption

WithToolsMenuItems appends menu items to the quickstart Tools group.

func WithTranslationCapabilityMenuMode added in v0.25.0

func WithTranslationCapabilityMenuMode(mode TranslationCapabilityMenuMode) ModuleRegistrarOption

WithTranslationCapabilityMenuMode controls how translation capability links are seeded into server-side navigation menus.

type MultiFS

type MultiFS []fs.FS

MultiFS tries each filesystem in order until one succeeds.

func (MultiFS) Open

func (m MultiFS) Open(name string) (fs.File, error)

Open implements fs.FS to provide fallback resolution.

func (MultiFS) Stat

func (m MultiFS) Stat(name string) (fs.FileInfo, error)

Stat implements fs.StatFS so callers can validate roots without requiring Open(".") to exist.

type OAuthTokenPolicyInput added in v0.25.0

type OAuthTokenPolicyInput struct {
	IsExpired      bool
	IsExpiringSoon bool
	CanAutoRefresh bool
}

OAuthTokenPolicyInput captures provider token status flags used by UI warnings.

type OAuthTokenPolicyState added in v0.25.0

type OAuthTokenPolicyState struct {
	IsExpired            bool
	IsExpiringSoon       bool
	CanAutoRefresh       bool
	NeedsReauthorization bool
}

OAuthTokenPolicyState contains derived UI policy for token warnings.

func ResolveOAuthTokenPolicy added in v0.25.0

func ResolveOAuthTokenPolicy(input OAuthTokenPolicyInput) OAuthTokenPolicyState

ResolveOAuthTokenPolicy derives UI flags from backend token state.

type OnboardingHandlers added in v0.19.0

type OnboardingHandlers struct {
	Invite               router.HandlerFunc
	VerifyInvite         router.HandlerFunc
	AcceptInvite         router.HandlerFunc
	SelfRegister         router.HandlerFunc
	ConfirmRegistration  router.HandlerFunc
	RequestPasswordReset router.HandlerFunc
	ConfirmPasswordReset router.HandlerFunc
	TokenMetadata        router.HandlerFunc
}

OnboardingHandlers provides handlers for onboarding routes.

type OnboardingRouteKey added in v0.19.0

type OnboardingRouteKey string

OnboardingRouteKey identifies a specific onboarding endpoint.

const (
	OnboardingRouteInvite               OnboardingRouteKey = "invite"
	OnboardingRouteInviteVerify         OnboardingRouteKey = "invite.verify"
	OnboardingRouteInviteAccept         OnboardingRouteKey = "invite.accept"
	OnboardingRouteRegister             OnboardingRouteKey = "register"
	OnboardingRouteRegisterConfirm      OnboardingRouteKey = "register.confirm"
	OnboardingRoutePasswordResetRequest OnboardingRouteKey = "password.reset.request"
	OnboardingRoutePasswordResetConfirm OnboardingRouteKey = "password.reset.confirm"
	OnboardingRouteTokenMetadata        OnboardingRouteKey = "token.metadata"
)

type OnboardingRouteOption added in v0.19.0

type OnboardingRouteOption func(*onboardingRouteOptions)

OnboardingRouteOption customizes onboarding route registration.

func WithOnboardingAuth added in v0.19.0

func WithOnboardingAuth(auth admin.HandlerAuthenticator) OnboardingRouteOption

WithOnboardingAuth configures the handler authenticator for protected routes.

func WithOnboardingBasePath added in v0.19.0

func WithOnboardingBasePath(basePath string) OnboardingRouteOption

WithOnboardingBasePath overrides the onboarding API base path.

func WithOnboardingProtectedRoutes added in v0.19.0

func WithOnboardingProtectedRoutes(keys ...OnboardingRouteKey) OnboardingRouteOption

WithOnboardingProtectedRoutes overrides which routes should be auth-wrapped.

func WithOnboardingRoutePaths added in v0.19.0

func WithOnboardingRoutePaths(paths OnboardingRoutePaths) OnboardingRouteOption

WithOnboardingRoutePaths overrides specific onboarding route paths.

type OnboardingRoutePaths added in v0.19.0

type OnboardingRoutePaths struct {
	Invite               string
	InviteVerify         string
	InviteAccept         string
	Register             string
	RegisterConfirm      string
	PasswordResetRequest string
	PasswordResetConfirm string
	TokenMetadata        string
}

OnboardingRoutePaths captures full route paths for onboarding endpoints.

func DefaultOnboardingRoutePaths added in v0.19.0

func DefaultOnboardingRoutePaths(basePath string) OnboardingRoutePaths

DefaultOnboardingRoutePaths builds onboarding API paths from the base path.

type PanelDataGridConfigOptions added in v0.25.0

type PanelDataGridConfigOptions struct {
	TableID             string
	APIEndpoint         string
	ActionBase          string
	PreferencesEndpoint string
	ColumnStorageKey    string
	EnableGroupedMode   bool
	DefaultViewMode     string
	GroupByField        string
	TranslationUX       bool
	StateStore          PanelDataGridStateStoreOptions
	URLState            PanelDataGridURLStateOptions
}

PanelDataGridConfigOptions configures datagrid wiring for panel templates.

type PanelDataGridStateStoreOptions added in v0.25.0

type PanelDataGridStateStoreOptions struct {
	Mode            string
	Resource        string
	SyncDebounceMS  int
	MaxShareEntries int
}

PanelDataGridStateStoreOptions configures datagrid state store wiring for templates.

type PanelDataGridURLStateOptions added in v0.25.0

type PanelDataGridURLStateOptions struct {
	MaxURLLength     int
	MaxFiltersLength int
	EnableStateToken *bool
}

PanelDataGridURLStateOptions configures datagrid URL sync limits.

type PanelViewCapabilityOptions added in v0.25.0

type PanelViewCapabilityOptions struct {
	BasePath       string
	URLResolver    urlkit.Resolver
	Definition     string
	Variant        string
	ExportEndpoint string
	DataGrid       PanelDataGridConfigOptions
}

PanelViewCapabilityOptions configures capability context derived for panel templates.

type PathViewContextConfig added in v0.25.0

type PathViewContextConfig struct {
	BasePath      string
	APIBasePath   string
	AssetBasePath string
	URLResolver   urlkit.Resolver
}

PathViewContextConfig describes how base/api/asset paths should be injected into a view context.

type PermissionDefinition

type PermissionDefinition struct {
	Key         string
	Description string
}

PermissionDefinition describes a permission entry for registration.

func PreferencesPermissions

func PreferencesPermissions() []PermissionDefinition

PreferencesPermissions returns the default permissions for preferences.

func TranslationExchangePermissions added in v0.25.0

func TranslationExchangePermissions() []PermissionDefinition

TranslationExchangePermissions returns default permissions for translation exchange flows.

func TranslationQueuePermissions added in v0.25.0

func TranslationQueuePermissions() []PermissionDefinition

TranslationQueuePermissions returns default permissions for translation queue flows.

type PermissionRegisterFunc

type PermissionRegisterFunc func(def PermissionDefinition) error

PermissionRegisterFunc registers a permission definition with a host registry.

type PlacementConfig

type PlacementConfig struct {
	MenuCodes      map[string]string
	DashboardAreas map[string]string
}

PlacementConfig maps logical placements to menu codes and dashboard areas.

func DefaultPlacements

func DefaultPlacements(cfg admin.Config) PlacementConfig

DefaultPlacements builds a placement map seeded with defaults.

func (PlacementConfig) DashboardAreaFor

func (p PlacementConfig) DashboardAreaFor(placement, fallback string) string

DashboardAreaFor returns the dashboard area for a placement, with fallback support.

func (PlacementConfig) MenuCodeFor

func (p PlacementConfig) MenuCodeFor(placement, fallback string) string

MenuCodeFor returns the menu code for a placement, falling back to the provided default.

type PreferencesModuleOption added in v0.24.0

type PreferencesModuleOption func(*admin.PreferencesModule)

PreferencesModuleOption customizes the Preferences module wiring in quickstart.

func WithPreferencesJSONEditorStrict added in v0.24.0

func WithPreferencesJSONEditorStrict(strict bool) PreferencesModuleOption

WithPreferencesJSONEditorStrict toggles client-side JSON editor strictness.

func WithPreferencesSchemaPath added in v0.24.0

func WithPreferencesSchemaPath(path string) PreferencesModuleOption

WithPreferencesSchemaPath overrides the preferences form schema path.

type RegistrationUIOption added in v0.19.0

type RegistrationUIOption func(*registrationUIOptions)

RegistrationUIOption customizes the registration UI route.

func WithRegistrationUIBasePath added in v0.19.0

func WithRegistrationUIBasePath(basePath string) RegistrationUIOption

WithRegistrationUIBasePath overrides the base path used by registration UI routes.

func WithRegistrationUIEnabled added in v0.19.0

func WithRegistrationUIEnabled(fn func(admin.Config) bool) RegistrationUIOption

WithRegistrationUIEnabled overrides the self-registration feature guard.

func WithRegistrationUIFeatureGate added in v0.20.0

func WithRegistrationUIFeatureGate(gate fggate.FeatureGate) RegistrationUIOption

WithRegistrationUIFeatureGate sets the feature gate used for default guards.

func WithRegistrationUIMode added in v0.19.0

func WithRegistrationUIMode(fn func(admin.Config) string) RegistrationUIOption

WithRegistrationUIMode overrides the registration mode label in the view context.

func WithRegistrationUIPasswordResetPath added in v0.19.0

func WithRegistrationUIPasswordResetPath(route string) RegistrationUIOption

WithRegistrationUIPasswordResetPath overrides the password reset route path.

func WithRegistrationUIRegisterPath added in v0.19.0

func WithRegistrationUIRegisterPath(route string) RegistrationUIOption

WithRegistrationUIRegisterPath overrides the registration route path.

func WithRegistrationUITemplate added in v0.19.0

func WithRegistrationUITemplate(name string) RegistrationUIOption

WithRegistrationUITemplate overrides the registration template name.

func WithRegistrationUIThemeAssets added in v0.19.0

func WithRegistrationUIThemeAssets(prefix string, assets map[string]string) RegistrationUIOption

WithRegistrationUIThemeAssets sets theme assets (logo, favicon, etc.) for registration UI templates. The prefix is prepended to each asset filename to form the full URL path. Assets are exposed in templates as theme.assets.logo, theme.assets.favicon, etc.

func WithRegistrationUITitle added in v0.19.0

func WithRegistrationUITitle(title string) RegistrationUIOption

WithRegistrationUITitle overrides the registration view title.

func WithRegistrationUIViewContextBuilder added in v0.19.0

func WithRegistrationUIViewContextBuilder(builder RegistrationUIViewContextBuilder) RegistrationUIOption

WithRegistrationUIViewContextBuilder overrides the default view context builder.

type RegistrationUIViewContextBuilder added in v0.19.0

type RegistrationUIViewContextBuilder func(ctx router.ViewContext, c router.Context) router.ViewContext

RegistrationUIViewContextBuilder mutates the view context for registration routes.

type RequestIPContext added in v0.26.0

type RequestIPContext interface {
	Header(name string) string
	IP() string
}

RequestIPContext captures the request methods needed to resolve client IP.

type RequestIPOptions added in v0.26.0

type RequestIPOptions struct {
	// TrustForwardedHeaders enables X-Forwarded-For, Forwarded, and X-Real-IP resolution.
	// Keep disabled unless your runtime sits behind a trusted proxy that sanitizes these headers.
	TrustForwardedHeaders bool
}

RequestIPOptions controls request IP extraction behavior.

type RolesUIOption added in v0.22.0

type RolesUIOption func(*rolesUIOptions)

func WithRolesBasePath added in v0.22.0

func WithRolesBasePath(basePath string) RolesUIOption

WithRolesBasePath overrides the base path used to build role routes.

func WithRolesFormGenerator added in v0.22.0

func WithRolesFormGenerator(formGen *formgenorchestrator.Orchestrator) RolesUIOption

WithRolesFormGenerator uses a custom form generator.

func WithRolesTemplates added in v0.22.0

func WithRolesTemplates(list, form, detail string) RolesUIOption

WithRolesTemplates overrides the template names for roles UI.

func WithRolesUIViewContext added in v0.22.0

func WithRolesUIViewContext(builder UIViewContextBuilder) RolesUIOption

WithRolesUIViewContext overrides the view context builder for roles routes.

type ScopeConfig added in v0.24.0

type ScopeConfig struct {
	Mode            ScopeMode
	DefaultTenantID string
	DefaultOrgID    string
}

ScopeConfig captures the quickstart scope behavior.

func DefaultScopeConfig added in v0.24.0

func DefaultScopeConfig() ScopeConfig

DefaultScopeConfig returns single-tenant defaults aligned with demo seeds.

func NormalizeScopeConfig added in v0.24.0

func NormalizeScopeConfig(cfg ScopeConfig) ScopeConfig

NormalizeScopeConfig ensures mode/defaults are set consistently.

func ScopeConfigFromAdmin added in v0.24.0

func ScopeConfigFromAdmin(cfg admin.Config) ScopeConfig

ScopeConfigFromAdmin maps admin.Config into a normalized ScopeConfig.

type ScopeDebugActor added in v0.24.0

type ScopeDebugActor struct {
	ID             string            `json:"id,omitempty"`
	Subject        string            `json:"subject,omitempty"`
	Role           string            `json:"role,omitempty"`
	TenantID       string            `json:"tenant_id,omitempty"`
	OrganizationID string            `json:"organization_id,omitempty"`
	Metadata       map[string]any    `json:"metadata,omitempty"`
	ImpersonatorID string            `json:"impersonator_id,omitempty"`
	IsImpersonated bool              `json:"is_impersonated,omitempty"`
	ResourceRoles  map[string]string `json:"resource_roles,omitempty"`
}

ScopeDebugActor captures actor context for a scope entry.

type ScopeDebugBuffer added in v0.24.0

type ScopeDebugBuffer struct {
	// contains filtered or unexported fields
}

ScopeDebugBuffer stores recent scope debug entries.

func NewScopeDebugBuffer added in v0.24.0

func NewScopeDebugBuffer(limit int) *ScopeDebugBuffer

NewScopeDebugBuffer allocates a buffer for scope debug entries.

func (*ScopeDebugBuffer) Add added in v0.24.0

func (b *ScopeDebugBuffer) Add(entry ScopeDebugEntry)

Add appends a scope debug entry to the buffer.

func (*ScopeDebugBuffer) Clear added in v0.24.0

func (b *ScopeDebugBuffer) Clear() error

Clear removes all buffered scope debug entries.

func (*ScopeDebugBuffer) Snapshot added in v0.24.0

func (b *ScopeDebugBuffer) Snapshot() ScopeDebugSnapshot

Snapshot returns a copy of the buffered scope debug entries.

type ScopeDebugClaims added in v0.24.0

type ScopeDebugClaims struct {
	Subject  string         `json:"subject,omitempty"`
	UserID   string         `json:"user_id,omitempty"`
	Role     string         `json:"role,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

ScopeDebugClaims captures JWT claims context for a scope entry.

type ScopeDebugDefaults added in v0.24.0

type ScopeDebugDefaults struct {
	TenantID bool `json:"tenant_id,omitempty"`
	OrgID    bool `json:"org_id,omitempty"`
}

ScopeDebugDefaults records which defaults were applied.

type ScopeDebugEntry added in v0.24.0

type ScopeDebugEntry struct {
	Timestamp       time.Time          `json:"timestamp"`
	Method          string             `json:"method,omitempty"`
	Path            string             `json:"path,omitempty"`
	ScopeMode       string             `json:"scope_mode,omitempty"`
	Actor           ScopeDebugActor    `json:"actor,omitempty"`
	Claims          ScopeDebugClaims   `json:"claims,omitempty"`
	RawScope        ScopeDebugScope    `json:"raw_scope,omitempty"`
	ResolvedScope   ScopeDebugScope    `json:"resolved_scope,omitempty"`
	DefaultScope    ScopeDebugScope    `json:"default_scope,omitempty"`
	DefaultsApplied ScopeDebugDefaults `json:"defaults_applied,omitempty"`
	Metadata        map[string]any     `json:"metadata,omitempty"`
	Headers         map[string]string  `json:"headers,omitempty"`
	Query           map[string]string  `json:"query,omitempty"`
	RouteParams     map[string]string  `json:"route_params,omitempty"`
	RequestID       string             `json:"request_id,omitempty"`
	Extra           map[string]any     `json:"extra,omitempty"`
}

ScopeDebugEntry captures a request scope resolution snapshot.

type ScopeDebugScope added in v0.24.0

type ScopeDebugScope struct {
	TenantID string `json:"tenant_id,omitempty"`
	OrgID    string `json:"org_id,omitempty"`
}

ScopeDebugScope represents tenant/org values in scope debug.

type ScopeDebugSnapshot added in v0.24.0

type ScopeDebugSnapshot struct {
	UpdatedAt time.Time         `json:"updated_at"`
	Count     int               `json:"count"`
	Limit     int               `json:"limit"`
	Entries   []ScopeDebugEntry `json:"entries"`
}

ScopeDebugSnapshot holds scope debug entries for the debug API.

type ScopeMode added in v0.24.0

type ScopeMode string

ScopeMode controls how tenant/org defaults are applied.

const (
	ScopeModeSingle ScopeMode = "single"
	ScopeModeMulti  ScopeMode = "multi"
)

type SecureLinkConfig added in v0.19.0

type SecureLinkConfig struct {
	SigningKey string
	Expiration time.Duration
	BaseURL    string
	QueryKey   string
	AsQuery    bool
	Routes     map[string]string
}

SecureLinkConfig captures securelink defaults for onboarding flows.

func DefaultSecureLinkConfig added in v0.26.0

func DefaultSecureLinkConfig(basePath string) SecureLinkConfig

DefaultSecureLinkConfig returns securelink defaults for onboarding flows.

func (SecureLinkConfig) Enabled added in v0.19.0

func (c SecureLinkConfig) Enabled() bool

Enabled reports whether the config has enough data to build a manager.

func (SecureLinkConfig) GetAsQuery added in v0.19.0

func (c SecureLinkConfig) GetAsQuery() bool

func (SecureLinkConfig) GetBaseURL added in v0.19.0

func (c SecureLinkConfig) GetBaseURL() string

func (SecureLinkConfig) GetExpiration added in v0.19.0

func (c SecureLinkConfig) GetExpiration() time.Duration

func (SecureLinkConfig) GetQueryKey added in v0.19.0

func (c SecureLinkConfig) GetQueryKey() string

func (SecureLinkConfig) GetRoutes added in v0.19.0

func (c SecureLinkConfig) GetRoutes() map[string]string

func (SecureLinkConfig) GetSigningKey added in v0.19.0

func (c SecureLinkConfig) GetSigningKey() string

type SecureLinkManagerSetter added in v0.19.0

type SecureLinkManagerSetter interface {
	WithSecureLinkManager(userstypes.SecureLinkManager)
}

SecureLinkManagerSetter allows injecting securelink managers into host components.

type SecureLinkUIConfig added in v0.19.0

type SecureLinkUIConfig struct {
	QueryKey string
	AsQuery  bool
}

SecureLinkUIConfig exposes link parsing details for templates.

func SecureLinkUIConfigFromConfig added in v0.26.0

func SecureLinkUIConfigFromConfig(cfg SecureLinkConfig) SecureLinkUIConfig

SecureLinkUIConfigFromConfig reads securelink parsing defaults from config.

type SecureLinkUsersOption added in v0.19.0

type SecureLinkUsersOption func(*secureLinkUsersOptions)

SecureLinkUsersOption customizes go-users securelink wiring.

func WithSecureLinkInviteRoute added in v0.19.0

func WithSecureLinkInviteRoute(route string) SecureLinkUsersOption

WithSecureLinkInviteRoute overrides the invite accept route key used by go-users.

func WithSecureLinkPasswordResetRoute added in v0.19.0

func WithSecureLinkPasswordResetRoute(route string) SecureLinkUsersOption

WithSecureLinkPasswordResetRoute overrides the password reset route key used by go-users.

func WithSecureLinkRegistrationRoute added in v0.19.0

func WithSecureLinkRegistrationRoute(route string) SecureLinkUsersOption

WithSecureLinkRegistrationRoute overrides the registration route key used by go-users.

type SeedLocalizedNavigationOptions added in v0.26.0

type SeedLocalizedNavigationOptions struct {
	MenuSvc       admin.CMSMenuService
	MenuCode      string
	Items         []LocalizedSeedMenuItem
	DefaultLocale string
	Reset         bool
	ResetEnv      string
	Logf          func(format string, args ...any)
	SkipLogger    bool

	// AutoCreateParents allows seeds to omit intermediate path segments; missing parents are scaffolded as group nodes.
	AutoCreateParents bool
}

SeedLocalizedNavigationOptions drives localized menu seeding with stable menu IDs.

type SeedNavigationOptions

type SeedNavigationOptions struct {
	MenuSvc    admin.CMSMenuService
	MenuCode   string
	Items      []admin.MenuItem
	Reset      bool
	ResetEnv   string
	Locale     string
	Logf       func(format string, args ...any)
	SkipLogger bool

	// AutoCreateParents allows seeds to omit intermediate path segments; missing parents are scaffolded as group nodes.
	AutoCreateParents bool
}

SeedNavigationOptions drives the quickstart menu seeding workflow.

type SessionUser

type SessionUser struct {
	ID              string            `json:"id,omitempty"`
	Subject         string            `json:"subject,omitempty"`
	Username        string            `json:"username,omitempty"`
	Email           string            `json:"email,omitempty"`
	Role            string            `json:"role,omitempty"`
	TenantID        string            `json:"tenant_id,omitempty"`
	OrganizationID  string            `json:"organization_id,omitempty"`
	Environment     string            `json:"environment,omitempty"`
	ResourceRoles   map[string]string `json:"resource_roles,omitempty"`
	Metadata        map[string]any    `json:"metadata,omitempty"`
	Scopes          []string          `json:"scopes,omitempty"`
	IssuedAt        *time.Time        `json:"issued_at,omitempty"`
	ExpiresAt       *time.Time        `json:"expires_at,omitempty"`
	IsAuthenticated bool              `json:"is_authenticated"`
	DisplayName     string            `json:"display_name,omitempty"`
	Subtitle        string            `json:"subtitle,omitempty"`
	Initial         string            `json:"initial,omitempty"`
	AvatarURL       string            `json:"avatar_url,omitempty"`
}

SessionUser captures session metadata to expose in templates and APIs.

func ApplyScopeDefaultsToSession added in v0.24.0

func ApplyScopeDefaultsToSession(session SessionUser, cfg admin.Config) SessionUser

ApplyScopeDefaultsToSession backfills tenant/org values for single-tenant mode.

func BuildSessionUser

func BuildSessionUser(ctx context.Context) SessionUser

BuildSessionUser extracts actor/claims data from the request context.

func FilterSessionUser

func FilterSessionUser(session SessionUser, gate fggate.FeatureGate) SessionUser

FilterSessionUser hides tenant/org data when those features are disabled.

func (SessionUser) ToViewContext

func (s SessionUser) ToViewContext() map[string]any

ToViewContext converts the session into snake_case keys for templates.

type SettingsUIOption added in v0.24.0

type SettingsUIOption func(*settingsUIOptions)

SettingsUIOption customizes the settings UI wiring.

func WithSettingsUIActive added in v0.24.0

func WithSettingsUIActive(active string) SettingsUIOption

WithSettingsUIActive overrides the active navigation key.

func WithSettingsUIRoute added in v0.24.0

func WithSettingsUIRoute(route string) SettingsUIOption

WithSettingsUIRoute overrides the URLKit admin route key.

func WithSettingsUITemplate added in v0.24.0

func WithSettingsUITemplate(name string) SettingsUIOption

WithSettingsUITemplate overrides the settings template name.

type SharedActivitySinks added in v0.19.0

type SharedActivitySinks struct {
	Admin admin.ActivitySink
	Auth  auth.ActivitySink
}

SharedActivitySinks bundles the admin + go-auth adapters.

func NewSharedActivitySinks added in v0.19.0

NewSharedActivitySinks builds a shared activity sink for admin/go-users/go-auth.

type StartupPolicy added in v0.25.0

type StartupPolicy = admin.ModuleStartupPolicy

StartupPolicy controls how module startup validation errors are handled.

const (
	// StartupPolicyEnforce fails startup when module startup validation fails.
	StartupPolicyEnforce StartupPolicy = admin.ModuleStartupPolicyEnforce
	// StartupPolicyWarn logs startup validation failures and continues.
	StartupPolicyWarn StartupPolicy = admin.ModuleStartupPolicyWarn
)

type StaticAssetsOption

type StaticAssetsOption func(*staticAssetsOptions)

StaticAssetsOption customizes the asset mounting behavior.

func WithAssetsPrefix

func WithAssetsPrefix(prefix string) StaticAssetsOption

WithAssetsPrefix overrides the base assets route prefix.

func WithDiskAssetsDir

func WithDiskAssetsDir(dir string) StaticAssetsOption

WithDiskAssetsDir configures a disk-backed asset directory (for dev overrides).

func WithDiskAssetsFS

func WithDiskAssetsFS(fsys fs.FS) StaticAssetsOption

WithDiskAssetsFS supplies a disk asset filesystem directly.

func WithEChartsPrefix

func WithEChartsPrefix(prefix string) StaticAssetsOption

WithEChartsPrefix overrides the go-dashboard ECharts assets prefix.

func WithExtraAssetsFS

func WithExtraAssetsFS(fsys ...fs.FS) StaticAssetsOption

WithExtraAssetsFS appends additional asset fallbacks.

func WithFormgenPrefix

func WithFormgenPrefix(prefix string) StaticAssetsOption

WithFormgenPrefix overrides the formgen assets route prefix.

func WithRuntimePrefix

func WithRuntimePrefix(prefix string) StaticAssetsOption

WithRuntimePrefix overrides the formgen runtime route prefix.

func WithSidebarAssetsFS

func WithSidebarAssetsFS(fsys fs.FS) StaticAssetsOption

WithSidebarAssetsFS overrides the default quickstart sidebar assets.

type TemplateFuncOption

type TemplateFuncOption func(*templateFuncOptions)

TemplateFuncOption customizes default template functions.

func WithTemplateBasePath added in v0.24.0

func WithTemplateBasePath(basePath string) TemplateFuncOption

WithTemplateBasePath configures the fallback base path used by adminURL helper.

func WithTemplateFeatureGate added in v0.20.0

func WithTemplateFeatureGate(gate fggate.FeatureGate, opts ...fgtemplates.HelperOption) TemplateFuncOption

WithTemplateFeatureGate registers feature template helpers using the provided gate.

func WithTemplateIconRenderer added in v0.25.0

func WithTemplateIconRenderer(renderFunc func(ref string, variant string) string) TemplateFuncOption

WithTemplateIconRenderer injects an icon renderer for template functions. The render function takes (ref string, variant string) and returns HTML. If not provided, templates use the built-in legacy icon rendering.

func WithTemplateURLResolver added in v0.24.0

func WithTemplateURLResolver(urls urlkit.Resolver) TemplateFuncOption

WithTemplateURLResolver configures the URLKit resolver used by adminURL helper.

func WithWidgetTitleFunc

func WithWidgetTitleFunc(fn func(string) string) TemplateFuncOption

WithWidgetTitleFunc replaces the widget title resolver.

func WithWidgetTitleMap

func WithWidgetTitleMap(titles map[string]string) TemplateFuncOption

WithWidgetTitleMap replaces the default widget title map.

func WithWidgetTitleOverrides

func WithWidgetTitleOverrides(overrides map[string]string) TemplateFuncOption

WithWidgetTitleOverrides updates the default widget title map.

type TemplateIconRenderer added in v0.25.0

type TemplateIconRenderer interface {
	RenderFromString(rawRef string, trusted bool, variant string) string
}

TemplateIconRenderer defines the interface for rendering icons in templates. This is satisfied by admin.IconService.

type ThemeOption

type ThemeOption func(*themeOptions)

ThemeOption customizes the default theme manifest/registry.

func WithThemeAssets

func WithThemeAssets(prefix string, files map[string]string) ThemeOption

WithThemeAssets configures default assets for the manifest.

func WithThemeManifest

func WithThemeManifest(manifest *theme.Manifest) ThemeOption

WithThemeManifest overrides the default manifest entirely.

func WithThemeRegistry

func WithThemeRegistry(registry theme.Registry) ThemeOption

WithThemeRegistry supplies a registry for theme registration.

func WithThemeVariants

func WithThemeVariants(variants map[string]theme.Variant) ThemeOption

WithThemeVariants overrides the default variant definitions.

type TranslationCapabilityMenuMode added in v0.25.0

type TranslationCapabilityMenuMode string

TranslationCapabilityMenuMode controls whether quickstart seeds translation capability menu items into the server-side navigation tree.

const (
	// TranslationCapabilityMenuModeNone keeps translation links out of server-seeded menus.
	// Use this when translation links are intentionally omitted from server-seeded navigation.
	TranslationCapabilityMenuModeNone TranslationCapabilityMenuMode = "none"
	// TranslationCapabilityMenuModeTools seeds translation links into a dedicated Translations group.
	// The name is retained for backward compatibility.
	TranslationCapabilityMenuModeTools TranslationCapabilityMenuMode = "tools"
)

type TranslationChecker added in v0.24.0

type TranslationChecker interface {
	CheckTranslations(ctx context.Context, id uuid.UUID, required []string, opts cmsinterfaces.TranslationCheckOptions) ([]string, error)
}

TranslationChecker is the minimal contract needed to validate translations.

type TranslationCriteria added in v0.24.0

type TranslationCriteria struct {
	Locales        []string            `json:"locales,omitempty"`
	RequiredFields map[string][]string `json:"required_fields,omitempty"`
}

TranslationCriteria captures locale/field requirements for a transition or environment.

type TranslationExchangeAsyncApplyFunc added in v0.25.0

type TranslationExchangeAsyncApplyFunc func(context.Context, admin.TranslationImportApplyInput) (admin.TranslationExchangeResult, error)

TranslationExchangeAsyncApplyFunc allows hosts to hand off apply flows to async backends. The implementation may enqueue work and return a queued/accepted result contract.

type TranslationExchangeConfig added in v0.25.0

type TranslationExchangeConfig struct {
	Enabled bool `json:"enabled,omitempty"`

	Store     admin.TranslationExchangeStore     `json:"-"`
	Exporter  admin.TranslationExchangeExporter  `json:"-"`
	Validator admin.TranslationExchangeValidator `json:"-"`
	Applier   admin.TranslationExchangeApplier   `json:"-"`

	AsyncApply TranslationExchangeAsyncApplyFunc `json:"-"`

	PermissionRegister PermissionRegisterFunc `json:"-"`
}

TranslationExchangeConfig configures optional translation exchange wiring in quickstart.

type TranslationPolicyConfig added in v0.24.0

type TranslationPolicyConfig struct {
	// DenyByDefault blocks transitions when no explicit requirements are configured.
	DenyByDefault bool `json:"deny_by_default,omitempty"`
	// RequiredFieldsStrategy controls how unknown required-field keys are handled.
	// Valid values: error, warn, ignore (defaults to error).
	RequiredFieldsStrategy admin.RequiredFieldsValidationStrategy `json:"required_fields_strategy,omitempty"`
	// PageEntities declares policy entities that should prefer the page translation
	// checker when both page/content checkers are configured.
	PageEntities []string `json:"page_entities,omitempty"`
	// EntityAliases maps input policy entities to canonical policy keys.
	// Useful for irregular nouns or legacy names that singular/plural inflection
	// cannot resolve deterministically.
	EntityAliases map[string]string `json:"entity_aliases,omitempty"`
	// Required maps entity -> transition -> requirements.
	Required map[string]TranslationPolicyEntityConfig `json:"required,omitempty"`
}

TranslationPolicyConfig captures translation enforcement rules for workflow transitions. Defaults are permissive (no enforcement) unless requirements are configured.

func DefaultContentTranslationPolicyConfig added in v0.25.0

func DefaultContentTranslationPolicyConfig() TranslationPolicyConfig

DefaultContentTranslationPolicyConfig returns a permissive, content-type agnostic baseline with no built-in entity assumptions.

func DefaultTranslationPolicyConfig added in v0.24.0

func DefaultTranslationPolicyConfig() TranslationPolicyConfig

DefaultTranslationPolicyConfig returns permissive defaults (no enforcement).

func NormalizeTranslationPolicyConfig added in v0.24.0

func NormalizeTranslationPolicyConfig(cfg TranslationPolicyConfig) TranslationPolicyConfig

NormalizeTranslationPolicyConfig applies defaults and normalizes strategy values.

type TranslationPolicyEntityCatalog added in v0.25.0

type TranslationPolicyEntityCatalog struct {
	Transitions map[string]TranslationPolicyTransitionCatalog
}

TranslationPolicyEntityCatalog describes known transitions and field keys for one entity.

type TranslationPolicyEntityConfig added in v0.24.0

type TranslationPolicyEntityConfig map[string]TranslationPolicyTransitionConfig

TranslationPolicyEntityConfig maps transition names to requirements.

type TranslationPolicyServices added in v0.24.0

type TranslationPolicyServices struct {
	Pages   TranslationChecker
	Content TranslationChecker
}

TranslationPolicyServices supplies translation checkers for pages and content.

type TranslationPolicyTransitionCatalog added in v0.25.0

type TranslationPolicyTransitionCatalog struct {
	RequiredFields []string
}

TranslationPolicyTransitionCatalog describes known required-field keys for one transition.

type TranslationPolicyTransitionConfig added in v0.24.0

type TranslationPolicyTransitionConfig struct {
	Locales        []string                       `json:"locales,omitempty"`
	RequiredFields map[string][]string            `json:"required_fields,omitempty"`
	Environments   map[string]TranslationCriteria `json:"environments,omitempty"`
}

TranslationPolicyTransitionConfig describes requirements for a transition and optional environments.

type TranslationPolicyValidationCatalog added in v0.25.0

type TranslationPolicyValidationCatalog struct {
	Entities map[string]TranslationPolicyEntityCatalog
}

TranslationPolicyValidationCatalog describes known policy entities/transitions/fields. Validation is optional and used by hosts that want strict startup checks.

func DefaultTranslationPolicyValidationCatalog added in v0.25.0

func DefaultTranslationPolicyValidationCatalog() TranslationPolicyValidationCatalog

DefaultTranslationPolicyValidationCatalog is empty by default so hosts can supply their own entity catalogs.

type TranslationPolicyValidationResult added in v0.25.0

type TranslationPolicyValidationResult struct {
	Warnings []string
}

TranslationPolicyValidationResult includes non-fatal warnings produced by validation.

func ValidateTranslationPolicyConfig added in v0.25.0

ValidateTranslationPolicyConfig validates policy keys against a known catalog. Strategy controls unknown-key handling: - error: returns an error - warn: records warnings - ignore: suppresses unknown-key issues

type TranslationProductConfig added in v0.25.0

type TranslationProductConfig struct {
	SchemaVersion int                        `json:"schema_version,omitempty"`
	Profile       TranslationProfile         `json:"profile,omitempty"`
	Exchange      *TranslationExchangeConfig `json:"exchange,omitempty"`
	Queue         *TranslationQueueConfig    `json:"queue,omitempty"`
}

TranslationProductConfig configures productized translation capabilities.

type TranslationProfile added in v0.25.0

type TranslationProfile string

TranslationProfile defines the quickstart translation capability profile.

const (
	TranslationProfileNone         TranslationProfile = "none"
	TranslationProfileCore         TranslationProfile = "core"
	TranslationProfileCoreExchange TranslationProfile = "core+exchange"
	TranslationProfileCoreQueue    TranslationProfile = "core+queue"
	TranslationProfileFull         TranslationProfile = "full"
)

type TranslationQueueConfig added in v0.25.0

type TranslationQueueConfig struct {
	Enabled             bool     `json:"enabled,omitempty"`
	EnableOpenPool      bool     `json:"enable_open_pool"`
	EnableDashboard     bool     `json:"enable_dashboard_widget"`
	EnableNotifications bool     `json:"enable_notifications"`
	EnableAutoCreate    bool     `json:"enable_auto_create"`
	DefaultPriority     string   `json:"default_priority,omitempty"`
	SupportedLocales    []string `json:"supported_locales,omitempty"`

	Repository admin.TranslationAssignmentRepository `json:"-"`
	Service    admin.TranslationQueueService         `json:"-"`

	PermissionRegister PermissionRegisterFunc `json:"-"`
}

TranslationQueueConfig configures optional translation queue wiring in quickstart.

type UIRouteOption added in v0.13.0

type UIRouteOption func(*uiRouteOptions)

UIRouteOption customizes the default UI route wiring.

func WithUIActivityActive added in v0.14.0

func WithUIActivityActive(active string) UIRouteOption

WithUIActivityActive sets the active menu key for the activity route.

func WithUIActivityPath added in v0.14.0

func WithUIActivityPath(route string) UIRouteOption

WithUIActivityPath overrides the activity route path.

func WithUIActivityRoute added in v0.14.0

func WithUIActivityRoute(enabled bool) UIRouteOption

WithUIActivityRoute toggles the activity route registration.

func WithUIActivityTemplate added in v0.14.0

func WithUIActivityTemplate(name string) UIRouteOption

WithUIActivityTemplate overrides the activity template name.

func WithUIActivityTitle added in v0.14.0

func WithUIActivityTitle(title string) UIRouteOption

WithUIActivityTitle overrides the activity view title.

func WithUIBasePath added in v0.13.0

func WithUIBasePath(basePath string) UIRouteOption

WithUIBasePath overrides the base path used to build default routes.

func WithUIDashboardActive added in v0.13.0

func WithUIDashboardActive(active string) UIRouteOption

WithUIDashboardActive sets the active menu key for the dashboard route.

func WithUIDashboardPath added in v0.13.0

func WithUIDashboardPath(route string) UIRouteOption

WithUIDashboardPath overrides the dashboard route path.

func WithUIDashboardRoute added in v0.13.0

func WithUIDashboardRoute(enabled bool) UIRouteOption

WithUIDashboardRoute toggles the dashboard route registration.

func WithUIDashboardTemplate added in v0.13.0

func WithUIDashboardTemplate(name string) UIRouteOption

WithUIDashboardTemplate overrides the dashboard template name.

func WithUIDashboardTitle added in v0.13.0

func WithUIDashboardTitle(title string) UIRouteOption

WithUIDashboardTitle overrides the dashboard view title.

func WithUIFeatureFlagsActive added in v0.21.0

func WithUIFeatureFlagsActive(active string) UIRouteOption

WithUIFeatureFlagsActive sets the active menu key for the feature flags route.

func WithUIFeatureFlagsPath added in v0.21.0

func WithUIFeatureFlagsPath(route string) UIRouteOption

WithUIFeatureFlagsPath overrides the feature flags route path.

func WithUIFeatureFlagsRoute added in v0.21.0

func WithUIFeatureFlagsRoute(enabled bool) UIRouteOption

WithUIFeatureFlagsRoute toggles the feature flags route registration.

func WithUIFeatureFlagsTemplate added in v0.21.0

func WithUIFeatureFlagsTemplate(name string) UIRouteOption

WithUIFeatureFlagsTemplate overrides the feature flags template name.

func WithUIFeatureFlagsTitle added in v0.21.0

func WithUIFeatureFlagsTitle(title string) UIRouteOption

WithUIFeatureFlagsTitle overrides the feature flags view title.

func WithUINotificationsActive added in v0.13.0

func WithUINotificationsActive(active string) UIRouteOption

WithUINotificationsActive sets the active menu key for the notifications route.

func WithUINotificationsPath added in v0.13.0

func WithUINotificationsPath(route string) UIRouteOption

WithUINotificationsPath overrides the notifications route path.

func WithUINotificationsRoute added in v0.13.0

func WithUINotificationsRoute(enabled bool) UIRouteOption

WithUINotificationsRoute toggles the notifications route registration.

func WithUINotificationsTemplate added in v0.13.0

func WithUINotificationsTemplate(name string) UIRouteOption

WithUINotificationsTemplate overrides the notifications template name.

func WithUINotificationsTitle added in v0.13.0

func WithUINotificationsTitle(title string) UIRouteOption

WithUINotificationsTitle overrides the notifications view title.

func WithUITranslationDashboardActive added in v0.25.0

func WithUITranslationDashboardActive(active string) UIRouteOption

WithUITranslationDashboardActive sets the active menu key for the translation dashboard route.

func WithUITranslationDashboardPath added in v0.25.0

func WithUITranslationDashboardPath(route string) UIRouteOption

WithUITranslationDashboardPath overrides the translation dashboard route path.

func WithUITranslationDashboardRoute added in v0.25.0

func WithUITranslationDashboardRoute(enabled bool) UIRouteOption

WithUITranslationDashboardRoute toggles the translation dashboard route registration.

func WithUITranslationDashboardTemplate added in v0.25.0

func WithUITranslationDashboardTemplate(name string) UIRouteOption

WithUITranslationDashboardTemplate overrides the translation dashboard template name.

func WithUITranslationDashboardTitle added in v0.25.0

func WithUITranslationDashboardTitle(title string) UIRouteOption

WithUITranslationDashboardTitle overrides the translation dashboard view title.

func WithUITranslationExchangeActive added in v0.25.0

func WithUITranslationExchangeActive(active string) UIRouteOption

WithUITranslationExchangeActive sets the active menu key for the translation exchange route.

func WithUITranslationExchangePath added in v0.25.0

func WithUITranslationExchangePath(route string) UIRouteOption

WithUITranslationExchangePath overrides the translation exchange route path.

func WithUITranslationExchangeRoute added in v0.25.0

func WithUITranslationExchangeRoute(enabled bool) UIRouteOption

WithUITranslationExchangeRoute toggles the translation exchange route registration.

func WithUITranslationExchangeTemplate added in v0.25.0

func WithUITranslationExchangeTemplate(name string) UIRouteOption

WithUITranslationExchangeTemplate overrides the translation exchange template name.

func WithUITranslationExchangeTitle added in v0.25.0

func WithUITranslationExchangeTitle(title string) UIRouteOption

WithUITranslationExchangeTitle overrides the translation exchange view title.

func WithUIViewContextBuilder added in v0.13.0

func WithUIViewContextBuilder(builder UIViewContextBuilder) UIRouteOption

WithUIViewContextBuilder overrides the default view context builder.

type UIViewContextBuilder added in v0.13.0

type UIViewContextBuilder func(ctx router.ViewContext, active string, c router.Context) router.ViewContext

UIViewContextBuilder mutates the view context for UI routes.

func DefaultAdminUIViewContextBuilder added in v0.24.0

func DefaultAdminUIViewContextBuilder(adm *admin.Admin, cfg admin.Config) UIViewContextBuilder

DefaultAdminUIViewContextBuilder returns the default admin UI view-context builder.

type UploadAuthorizeFunc added in v0.25.0

type UploadAuthorizeFunc func(context.Context) error

UploadAuthorizeFunc validates whether the request context can upload files. Return a non-nil error to block the upload.

type UploadHandlerConfig added in v0.25.0

type UploadHandlerConfig struct {
	BasePath            string
	DiskAssetsDir       string
	FormField           string
	UploadSubdir        string
	ResolveUploadSubdir UploadSubdirResolver
	MaxFileSize         int64
	AllowedMimeTypes    map[string]bool
	AllowedImageFormats map[string]bool
	Provider            uploader.Uploader
	Validator           *uploader.Validator
	Manager             *uploader.Manager
	Authorize           UploadAuthorizeFunc
	PublicURL           UploadPublicURLFunc
	Response            UploadResponseFunc
}

UploadHandlerConfig configures a multipart upload endpoint backed by go-uploader.

type UploadPublicURLFunc added in v0.25.0

type UploadPublicURLFunc func(basePath string, meta *uploader.FileMeta) string

UploadPublicURLFunc builds the public URL returned in the JSON response.

type UploadResponseFunc added in v0.25.0

type UploadResponseFunc func(publicURL string, meta *uploader.FileMeta) any

UploadResponseFunc customizes the JSON response payload.

type UploadSubdirResolver added in v0.25.0

type UploadSubdirResolver func(router.Context) string

UploadSubdirResolver resolves the upload subdirectory for the current request.

type UserMigrationObserver added in v0.26.0

type UserMigrationObserver func(UserMigrationRegistration)

UserMigrationObserver receives ordered migration registration events.

type UserMigrationRegistration added in v0.26.0

type UserMigrationRegistration struct {
	Label string
}

UserMigrationRegistration records one ordered migration registration step.

type UserMigrationsOption added in v0.19.0

type UserMigrationsOption func(*userMigrationsOptions)

UserMigrationsOption customizes user-related migrations registration.

func WithUserMigrationsAuthBootstrapEnabled added in v0.19.0

func WithUserMigrationsAuthBootstrapEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsAuthBootstrapEnabled toggles go-users auth bootstrap migrations.

func WithUserMigrationsAuthBootstrapFS added in v0.19.0

func WithUserMigrationsAuthBootstrapFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsAuthBootstrapFS overrides go-users auth bootstrap migrations.

func WithUserMigrationsAuthEnabled added in v0.19.0

func WithUserMigrationsAuthEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsAuthEnabled toggles go-auth migrations.

func WithUserMigrationsAuthExtrasEnabled added in v0.19.0

func WithUserMigrationsAuthExtrasEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsAuthExtrasEnabled toggles go-users auth extras migrations.

func WithUserMigrationsAuthExtrasFS added in v0.19.0

func WithUserMigrationsAuthExtrasFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsAuthExtrasFS overrides go-users auth extras migrations.

func WithUserMigrationsAuthFS added in v0.19.0

func WithUserMigrationsAuthFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsAuthFS overrides the go-auth migrations filesystem (rooted at data/sql/migrations).

func WithUserMigrationsCoreEnabled added in v0.19.0

func WithUserMigrationsCoreEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsCoreEnabled toggles go-users core migrations.

func WithUserMigrationsCoreFS added in v0.19.0

func WithUserMigrationsCoreFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsCoreFS overrides the go-users core migrations filesystem (rooted at data/sql/migrations).

func WithUserMigrationsObserver added in v0.26.0

func WithUserMigrationsObserver(observer UserMigrationObserver) UserMigrationsOption

WithUserMigrationsObserver captures ordered migration registration steps.

func WithUserMigrationsProfile added in v0.26.0

func WithUserMigrationsProfile(profile UserMigrationsProfile) UserMigrationsOption

WithUserMigrationsProfile sets the canonical user migration registration profile.

func WithUserMigrationsValidationTargets added in v0.19.0

func WithUserMigrationsValidationTargets(targets ...string) UserMigrationsOption

WithUserMigrationsValidationTargets overrides validation targets used by go-persistence-bun.

type UserMigrationsProfile added in v0.26.0

type UserMigrationsProfile string

UserMigrationsProfile controls which migration sources are registered.

const (
	// UserMigrationsProfileCombined registers go-auth plus go-users core migrations.
	UserMigrationsProfileCombined UserMigrationsProfile = "combined"
	// UserMigrationsProfileAuthOnly registers only go-auth migrations.
	UserMigrationsProfileAuthOnly UserMigrationsProfile = "auth-only"
	// UserMigrationsProfileUsersStandalone registers go-users standalone tracks.
	UserMigrationsProfileUsersStandalone UserMigrationsProfile = "users-standalone"
)

type ViewEngineOption

type ViewEngineOption func(*viewEngineOptions)

ViewEngineOption customizes the view engine config.

func WithViewAssetsFS

func WithViewAssetsFS(fsys ...fs.FS) ViewEngineOption

WithViewAssetsFS appends asset fallbacks.

func WithViewBasePath added in v0.24.0

func WithViewBasePath(basePath string) ViewEngineOption

WithViewBasePath sets the fallback admin base path used by template helpers (adminURL).

func WithViewDebug

func WithViewDebug(enabled bool) ViewEngineOption

WithViewDebug toggles view engine debug mode.

func WithViewEmbed

func WithViewEmbed(enabled bool) ViewEngineOption

WithViewEmbed toggles embedded filesystem usage.

func WithViewExt

func WithViewExt(ext string) ViewEngineOption

WithViewExt sets the template extension.

func WithViewFeatureGate added in v0.20.0

func WithViewFeatureGate(gate fggate.FeatureGate, helperOpts ...fgtemplates.HelperOption) ViewEngineOption

WithViewFeatureGate registers feature template helpers using the provided gate.

func WithViewReload

func WithViewReload(enabled bool) ViewEngineOption

WithViewReload toggles template reload behavior.

func WithViewTemplateFuncs

func WithViewTemplateFuncs(funcs map[string]any) ViewEngineOption

WithViewTemplateFuncs overrides template functions.

func WithViewTemplatesFS

func WithViewTemplatesFS(fsys ...fs.FS) ViewEngineOption

WithViewTemplatesFS appends template fallbacks.

func WithViewURLPrefix

func WithViewURLPrefix(prefix string) ViewEngineOption

WithViewURLPrefix sets the assets URL prefix.

func WithViewURLResolver added in v0.24.0

func WithViewURLResolver(urls urlkit.Resolver) ViewEngineOption

WithViewURLResolver sets the URLKit resolver used by template helpers.

type WorkflowBindingSpec added in v0.26.0

type WorkflowBindingSpec struct {
	ID          string `json:"id,omitempty" yaml:"id,omitempty"`
	ScopeType   string `json:"scope_type,omitempty" yaml:"scope_type,omitempty"`
	ScopeRef    string `json:"scope_ref,omitempty" yaml:"scope_ref,omitempty"`
	WorkflowID  string `json:"workflow_id,omitempty" yaml:"workflow_id,omitempty"`
	Priority    int    `json:"priority,omitempty" yaml:"priority,omitempty"`
	Status      string `json:"status,omitempty" yaml:"status,omitempty"`
	Environment string `json:"environment,omitempty" yaml:"environment,omitempty"`
}

WorkflowBindingSpec describes one canonical runtime binding in external config.

type WorkflowConfig added in v0.25.0

type WorkflowConfig struct {
	SchemaVersion int                               `json:"schema_version,omitempty" yaml:"schema_version,omitempty"`
	Workflows     map[string]WorkflowDefinitionSpec `json:"workflows,omitempty" yaml:"workflows,omitempty"`
	Bindings      []WorkflowBindingSpec             `json:"bindings,omitempty" yaml:"bindings,omitempty"`
	TraitDefaults map[string]string                 `json:"trait_defaults,omitempty" yaml:"trait_defaults,omitempty"`
}

WorkflowConfig captures external workflow definitions and trait workflow defaults.

func DefaultWorkflowConfig added in v0.25.0

func DefaultWorkflowConfig() WorkflowConfig

DefaultWorkflowConfig returns an empty config with current schema version.

func LoadWorkflowConfigFile added in v0.25.0

func LoadWorkflowConfigFile(path string) (WorkflowConfig, error)

LoadWorkflowConfigFile parses a JSON/YAML workflow config file.

func MergeWorkflowConfigs added in v0.25.0

func MergeWorkflowConfigs(base WorkflowConfig, override WorkflowConfig) WorkflowConfig

MergeWorkflowConfigs merges two configs where override values win.

func NormalizeWorkflowConfig added in v0.25.0

func NormalizeWorkflowConfig(cfg WorkflowConfig) WorkflowConfig

NormalizeWorkflowConfig normalizes config maps and scalar fields.

func ParseWorkflowConfigContents added in v0.25.0

func ParseWorkflowConfigContents(raw []byte, ext string) (WorkflowConfig, error)

ParseWorkflowConfigContents parses JSON/YAML workflow config contents.

type WorkflowConfigValidationError added in v0.25.0

type WorkflowConfigValidationError struct {
	Issues []WorkflowConfigValidationIssue `json:"issues"`
}

WorkflowConfigValidationError aggregates config validation issues.

func (WorkflowConfigValidationError) Error added in v0.25.0

func (WorkflowConfigValidationError) Is added in v0.25.0

type WorkflowConfigValidationIssue added in v0.25.0

type WorkflowConfigValidationIssue struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

WorkflowConfigValidationIssue reports one actionable field-level validation issue.

type WorkflowDefinitionSpec added in v0.25.0

type WorkflowDefinitionSpec struct {
	ID             string                   `json:"id,omitempty" yaml:"id,omitempty"`
	MachineVersion string                   `json:"machine_version,omitempty" yaml:"machine_version,omitempty"`
	InitialState   string                   `json:"initial_state,omitempty" yaml:"initial_state,omitempty"`
	Transitions    []WorkflowTransitionSpec `json:"transitions,omitempty" yaml:"transitions,omitempty"`
}

WorkflowDefinitionSpec describes one workflow definition declared in config. The map key under WorkflowConfig.Workflows is treated as workflow ID unless ID is set.

type WorkflowTransitionSpec added in v0.25.0

type WorkflowTransitionSpec struct {
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	From        string `json:"from,omitempty" yaml:"from,omitempty"`
	To          string `json:"to,omitempty" yaml:"to,omitempty"`
	Guard       string `json:"guard,omitempty" yaml:"guard,omitempty"`
}

WorkflowTransitionSpec describes one workflow transition in external config.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL