Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyAdapterIntegrations(adm *admin.Admin, result *AdapterResult, hooks AdapterHooks)
- func ApplySecureLinkManager(cfg *userssvc.Config, manager userstypes.SecureLinkManager, ...)
- func ApplySecureLinkManagerToAuth(target SecureLinkManagerSetter, manager userstypes.SecureLinkManager)
- func AttachDebugLogHandler(cfg admin.Config, adm *admin.Admin)
- func AttachDebugMiddleware[T any](r router.Router[T], cfg admin.Config, adm *admin.Admin)
- func AttachGoAuthActivitySink(auther *auth.Auther, sink admin.ActivitySink, opts ...GoAuthActivitySinkOption)
- func AuthUIViewContext(cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext
- func BuildNavItems(adm *admin.Admin, cfg admin.Config, ctx context.Context, active string) []map[string]any
- func BuildNavItemsForPlacement(adm *admin.Admin, cfg admin.Config, placements PlacementConfig, ...) []map[string]any
- func ConfigureExportRenderers(bundle *ExportBundle, templatesFS fs.FS, opts ...ExportTemplateOption) error
- func DashboardTemplatesFS() fs.FS
- func DefaultAdminFeatures() map[string]bool
- func DefaultMenuParents(menuCode string) []admin.MenuItem
- func DefaultMinimalFeatures() map[string]bool
- func DefaultSecureLinkRoutes(basePath string) map[string]string
- func DefaultTemplateFuncs(opts ...TemplateFuncOption) map[string]any
- func DefaultThemeTokens() map[string]string
- func EnsureDefaultMenuParents(ctx context.Context, menuSvc admin.CMSMenuService, menuCode, locale string) error
- func MergeComponentDescriptors(base, override components.Descriptor) components.Descriptor
- func MergeTemplateFuncs(overrides map[string]any, opts ...TemplateFuncOption) map[string]any
- func NewAdminConfig(basePath, title, defaultLocale string, opts ...AdminConfigOption) admin.Config
- func NewAdminWithGoUsersPreferences(cfg admin.Config, repo types.PreferenceRepository, opts ...PreferencesOption) (*admin.Admin, error)
- func NewCompositeActivitySink(primary admin.ActivitySink, hooks dashboardactivity.Hooks, ...) admin.ActivitySink
- func NewFiberErrorHandler(adm *admin.Admin, cfg admin.Config, isDev bool, ...) fiber.ErrorHandler
- func NewFiberServer(viewEngine fiber.Views, cfg admin.Config, adm *admin.Admin, isDev bool, ...) (router.Server[*fiber.App], router.Router[*fiber.App])
- func NewFormGenerator(openapiFS fs.FS, templatesFS fs.FS, opts ...FormGeneratorOption) (*formgenorchestrator.Orchestrator, error)
- func NewGoAuthActivitySink(sink admin.ActivitySink, opts ...GoAuthActivitySinkOption) auth.ActivitySink
- func NewModuleRegistrar(adm *admin.Admin, cfg admin.Config, modules []admin.Module, isDev bool, ...) error
- func NewNotificationsSecureLinkManager(cfg SecureLinkConfig) (links.SecureLinkManager, error)
- func NewSecureLinkManager(cfg SecureLinkConfig) (userstypes.SecureLinkManager, error)
- func NewSecureLinkNotificationBuilder(manager links.SecureLinkManager, opts ...linknotifications.Option) links.LinkBuilder
- func NewStaticAssets(r router.Router[*fiber.App], cfg admin.Config, assetsFS fs.FS, ...)
- func NewThemeSelector(name, variant string, tokenOverrides map[string]string, opts ...ThemeOption) (theme.Selector, *theme.Manifest, error)
- func NewViewEngine(baseFS fs.FS, opts ...ViewEngineOption) (fiber.Views, error)
- func RegisterAdminUIRoutes(r router.Router[*fiber.App], cfg admin.Config, adm *admin.Admin, ...) error
- func RegisterAuthUIRoutes(r router.Router[*fiber.App], cfg admin.Config, auther *auth.Auther, ...) error
- func RegisterOnboardingRoutes(r router.Router[*fiber.App], cfg admin.Config, handlers OnboardingHandlers, ...) error
- func RegisterPreferencesPermissions(register PermissionRegisterFunc) error
- func RegisterRegistrationUIRoutes(r router.Router[*fiber.App], cfg admin.Config, opts ...RegistrationUIOption) error
- func RegisterUserMigrations(client *persistence.Client, opts ...UserMigrationsOption) error
- func ResolveDiskAssetsDir(marker string, candidates ...string) string
- func SeedNavigation(ctx context.Context, opts SeedNavigationOptions) error
- func SidebarAssetsFS() fs.FS
- func SidebarTemplatesFS() fs.FS
- func WithAuthUIViewContext(ctx router.ViewContext, cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext
- func WithAuthUIViewThemeAssets(ctx router.ViewContext, assets map[string]string, assetPrefix string) router.ViewContext
- func WithDefaultDashboardRenderer(adm *admin.Admin, viewEngine fiber.Views, cfg admin.Config, ...) error
- func WithFallbackFS(primary fs.FS, fallbacks ...fs.FS) fs.FS
- func WithFeatureTemplateContext(ctx router.ViewContext, reqCtx context.Context, scope any, snapshot any) router.ViewContext
- func WithGoAuth(adm *admin.Admin, routeAuth *auth.RouteAuthenticator, cfg auth.Config, ...) (*admin.GoAuthAuthenticator, *admin.GoAuthAuthorizer)
- func WithNav(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, active string, ...) router.ViewContext
- func WithNavPlacements(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, ...) router.ViewContext
- func WithThemeContext(ctx router.ViewContext, adm *admin.Admin, req router.Context) router.ViewContext
- type AdapterFlags
- type AdapterHooks
- type AdapterResult
- func ConfigureAdapters(ctx context.Context, cfg admin.Config, hooks AdapterHooks) (admin.Config, AdapterResult)
- func ConfigureAdaptersWithFlags(ctx context.Context, cfg admin.Config, hooks AdapterHooks, flags AdapterFlags) (admin.Config, AdapterResult)
- func NewAdmin(cfg admin.Config, hooks AdapterHooks, opts ...AdminOption) (*admin.Admin, AdapterResult, error)
- type AdminConfigOption
- func WithDebugConfig(debugCfg admin.DebugConfig) AdminConfigOption
- func WithDebugFromEnv(opts ...DebugEnvOption) AdminConfigOption
- func WithNavMenuCode(code string) AdminConfigOption
- func WithTheme(name, variant string) AdminConfigOption
- func WithThemeAssetPrefix(prefix string) AdminConfigOption
- func WithThemeTokens(tokens map[string]string) AdminConfigOption
- type AdminOption
- type AsyncRequesterFactory
- type AuthUIOption
- func WithAuthUIBasePath(basePath string) AuthUIOption
- func WithAuthUICookie(cookie router.Cookie) AuthUIOption
- func WithAuthUIFeatureGate(gate fggate.FeatureGate) AuthUIOption
- func WithAuthUILoginPath(route string) AuthUIOption
- func WithAuthUILoginRedirect(route string) AuthUIOption
- func WithAuthUILogoutPath(route string) AuthUIOption
- func WithAuthUILogoutRedirect(route string) AuthUIOption
- func WithAuthUIPasswordResetConfirmPath(route string) AuthUIOption
- func WithAuthUIPasswordResetConfirmTemplate(name string) AuthUIOption
- func WithAuthUIPasswordResetConfirmTitle(title string) AuthUIOption
- func WithAuthUIPasswordResetEnabled(fn func(admin.Config) bool) AuthUIOption
- func WithAuthUIPasswordResetPath(route string) AuthUIOption
- func WithAuthUIRegisterPath(route string) AuthUIOption
- func WithAuthUISelfRegistrationEnabled(fn func(admin.Config) bool) AuthUIOption
- func WithAuthUITemplates(loginTemplate, passwordResetTemplate string) AuthUIOption
- func WithAuthUIThemeAssets(prefix string, assets map[string]string) AuthUIOption
- func WithAuthUITitles(loginTitle, passwordResetTitle string) AuthUIOption
- func WithAuthUIViewContextBuilder(builder AuthUIViewContextBuilder) AuthUIOption
- type AuthUIPaths
- type AuthUIState
- type AuthUIViewContextBuilder
- type DashboardRendererOption
- type DebugEnvOption
- type ExportBundle
- type ExportBundleOption
- func WithExportActorProvider(provider export.ActorProvider) ExportBundleOption
- func WithExportAsyncInProcess(timeout time.Duration) ExportBundleOption
- func WithExportAsyncRequester(factory AsyncRequesterFactory) ExportBundleOption
- func WithExportBasePath(path string) ExportBundleOption
- func WithExportDeliveryPolicy(policy export.DeliveryPolicy) ExportBundleOption
- func WithExportGuard(guard export.Guard) ExportBundleOption
- func WithExportHistoryPath(path string) ExportBundleOption
- func WithExportLogger(logger export.Logger) ExportBundleOption
- func WithExportMaxBufferBytes(maxBytes int64) ExportBundleOption
- func WithExportPathSuffix(suffix string) ExportBundleOption
- func WithExportQueryRequestDecoder(decoder exportapi.RequestDecoder) ExportBundleOption
- func WithExportRequestDecoder(decoder exportapi.RequestDecoder) ExportBundleOption
- func WithExportStore(store export.ArtifactStore) ExportBundleOption
- func WithExportTracker(tracker export.ProgressTracker) ExportBundleOption
- type ExportTemplateOption
- func WithExportPDFRenderer(builder func(exporttemplate.Renderer) (exportpdf.Renderer, error)) ExportTemplateOption
- func WithExportTemplateFuncs(funcs map[string]any) ExportTemplateOption
- func WithExportTemplateMaxRows(rows int) ExportTemplateOption
- func WithExportTemplateName(name string) ExportTemplateOption
- type FiberErrorHandlerOption
- type FiberServerOption
- type FormGeneratorOption
- type GoAuthActivitySinkOption
- type GoUsersPreferencesStore
- func (s *GoUsersPreferencesStore) Delete(ctx context.Context, input admin.PreferencesDeleteInput) error
- func (s *GoUsersPreferencesStore) Resolve(ctx context.Context, input admin.PreferencesResolveInput) (admin.PreferenceSnapshot, error)
- func (s *GoUsersPreferencesStore) Upsert(ctx context.Context, input admin.PreferencesUpsertInput) (admin.PreferenceSnapshot, error)
- type ModuleRegistrarOption
- func WithModuleFeatureDisabledHandler(handler func(feature, moduleID string) error) ModuleRegistrarOption
- func WithModuleFeatureGates(gates fggate.FeatureGate) ModuleRegistrarOption
- func WithModuleMenuItems(items ...admin.MenuItem) ModuleRegistrarOption
- func WithModuleRegistrarContext(ctx context.Context) ModuleRegistrarOption
- func WithSeedNavigation(enabled bool) ModuleRegistrarOption
- func WithSeedNavigationOptions(mutator func(*SeedNavigationOptions)) ModuleRegistrarOption
- type MultiFS
- type OnboardingHandlers
- type OnboardingRouteKey
- type OnboardingRouteOption
- func WithOnboardingAuth(auth admin.HandlerAuthenticator) OnboardingRouteOption
- func WithOnboardingBasePath(basePath string) OnboardingRouteOption
- func WithOnboardingProtectedRoutes(keys ...OnboardingRouteKey) OnboardingRouteOption
- func WithOnboardingRoutePaths(paths OnboardingRoutePaths) OnboardingRouteOption
- type OnboardingRoutePaths
- type PermissionDefinition
- type PermissionRegisterFunc
- type PlacementConfig
- type PreferencesOption
- type RegistrationUIOption
- func WithRegistrationUIBasePath(basePath string) RegistrationUIOption
- func WithRegistrationUIEnabled(fn func(admin.Config) bool) RegistrationUIOption
- func WithRegistrationUIFeatureGate(gate fggate.FeatureGate) RegistrationUIOption
- func WithRegistrationUIMode(fn func(admin.Config) string) RegistrationUIOption
- func WithRegistrationUIPasswordResetPath(route string) RegistrationUIOption
- func WithRegistrationUIRegisterPath(route string) RegistrationUIOption
- func WithRegistrationUITemplate(name string) RegistrationUIOption
- func WithRegistrationUIThemeAssets(prefix string, assets map[string]string) RegistrationUIOption
- func WithRegistrationUITitle(title string) RegistrationUIOption
- func WithRegistrationUIViewContextBuilder(builder RegistrationUIViewContextBuilder) RegistrationUIOption
- type RegistrationUIViewContextBuilder
- type SecureLinkConfig
- func (c SecureLinkConfig) Enabled() bool
- func (c SecureLinkConfig) GetAsQuery() bool
- func (c SecureLinkConfig) GetBaseURL() string
- func (c SecureLinkConfig) GetExpiration() time.Duration
- func (c SecureLinkConfig) GetQueryKey() string
- func (c SecureLinkConfig) GetRoutes() map[string]string
- func (c SecureLinkConfig) GetSigningKey() string
- type SecureLinkManagerSetter
- type SecureLinkUIConfig
- type SecureLinkUsersOption
- type SeedNavigationOptions
- type SessionUser
- type SharedActivitySinks
- type StaticAssetsOption
- func WithAssetsPrefix(prefix string) StaticAssetsOption
- func WithDiskAssetsDir(dir string) StaticAssetsOption
- func WithDiskAssetsFS(fsys fs.FS) StaticAssetsOption
- func WithEChartsPrefix(prefix string) StaticAssetsOption
- func WithExtraAssetsFS(fsys ...fs.FS) StaticAssetsOption
- func WithFormgenPrefix(prefix string) StaticAssetsOption
- func WithRuntimePrefix(prefix string) StaticAssetsOption
- func WithSidebarAssetsFS(fsys fs.FS) StaticAssetsOption
- type TemplateFuncOption
- func WithTemplateFeatureGate(gate fggate.FeatureGate, opts ...fgtemplates.HelperOption) TemplateFuncOption
- func WithWidgetTitleFunc(fn func(string) string) TemplateFuncOption
- func WithWidgetTitleMap(titles map[string]string) TemplateFuncOption
- func WithWidgetTitleOverrides(overrides map[string]string) TemplateFuncOption
- type ThemeOption
- type UIRouteOption
- func WithUIActivityActive(active string) UIRouteOption
- func WithUIActivityPath(route string) UIRouteOption
- func WithUIActivityRoute(enabled bool) UIRouteOption
- func WithUIActivityTemplate(name string) UIRouteOption
- func WithUIActivityTitle(title string) UIRouteOption
- func WithUIBasePath(basePath string) UIRouteOption
- func WithUIDashboardActive(active string) UIRouteOption
- func WithUIDashboardPath(route string) UIRouteOption
- func WithUIDashboardRoute(enabled bool) UIRouteOption
- func WithUIDashboardTemplate(name string) UIRouteOption
- func WithUIDashboardTitle(title string) UIRouteOption
- func WithUIFeatureFlagsActive(active string) UIRouteOption
- func WithUIFeatureFlagsPath(route string) UIRouteOption
- func WithUIFeatureFlagsRoute(enabled bool) UIRouteOption
- func WithUIFeatureFlagsTemplate(name string) UIRouteOption
- func WithUIFeatureFlagsTitle(title string) UIRouteOption
- func WithUINotificationsActive(active string) UIRouteOption
- func WithUINotificationsPath(route string) UIRouteOption
- func WithUINotificationsRoute(enabled bool) UIRouteOption
- func WithUINotificationsTemplate(name string) UIRouteOption
- func WithUINotificationsTitle(title string) UIRouteOption
- func WithUIViewContextBuilder(builder UIViewContextBuilder) UIRouteOption
- type UIViewContextBuilder
- type UserMigrationsOption
- func WithUserMigrationsAuthBootstrapEnabled(enabled bool) UserMigrationsOption
- func WithUserMigrationsAuthBootstrapFS(fsys fs.FS) UserMigrationsOption
- func WithUserMigrationsAuthEnabled(enabled bool) UserMigrationsOption
- func WithUserMigrationsAuthExtrasEnabled(enabled bool) UserMigrationsOption
- func WithUserMigrationsAuthExtrasFS(fsys fs.FS) UserMigrationsOption
- func WithUserMigrationsAuthFS(fsys fs.FS) UserMigrationsOption
- func WithUserMigrationsCoreEnabled(enabled bool) UserMigrationsOption
- func WithUserMigrationsCoreFS(fsys fs.FS) UserMigrationsOption
- func WithUserMigrationsValidationTargets(targets ...string) UserMigrationsOption
- type ViewEngineOption
- func WithViewAssetsFS(fsys ...fs.FS) ViewEngineOption
- func WithViewDebug(enabled bool) ViewEngineOption
- func WithViewEmbed(enabled bool) ViewEngineOption
- func WithViewExt(ext string) ViewEngineOption
- func WithViewFeatureGate(gate fggate.FeatureGate, helperOpts ...fgtemplates.HelperOption) ViewEngineOption
- func WithViewReload(enabled bool) ViewEngineOption
- func WithViewTemplateFuncs(funcs map[string]any) ViewEngineOption
- func WithViewTemplatesFS(fsys ...fs.FS) ViewEngineOption
- func WithViewURLPrefix(prefix string) ViewEngineOption
Constants ¶
DefaultNavMenuCode is the quickstart default menu identifier.
Variables ¶
ErrSeedNavigationRequiresGoCMS is returned when SeedNavigation is invoked with a non go-cms backed menu service.
Functions ¶
func ApplyAdapterIntegrations ¶
func ApplyAdapterIntegrations(adm *admin.Admin, result *AdapterResult, hooks AdapterHooks)
ApplyAdapterIntegrations wires optional adapters post-admin initialization.
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
AttachDebugLogHandler wires slog to the debug collector when CaptureLogs is enabled.
func AttachDebugMiddleware ¶ added in v0.15.0
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 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 ¶
DashboardTemplatesFS returns the embedded dashboard templates filesystem.
func DefaultAdminFeatures ¶
DefaultAdminFeatures returns the baseline feature defaults for quickstart.
func DefaultMenuParents ¶
DefaultMenuParents returns the baseline parents/groups used by quickstart modules.
func DefaultMinimalFeatures ¶
DefaultMinimalFeatures returns a Stage 1 friendly feature default set.
func DefaultSecureLinkRoutes ¶ added in v0.19.0
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 ¶
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 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 NewAdminConfig ¶
func NewAdminConfig(basePath, title, defaultLocale string, opts ...AdminConfigOption) admin.Config
NewAdminConfig builds a baseline admin config with quickstart defaults.
func NewAdminWithGoUsersPreferences ¶
func NewAdminWithGoUsersPreferences(cfg admin.Config, repo types.PreferenceRepository, opts ...PreferencesOption) (*admin.Admin, error)
NewAdminWithGoUsersPreferences wires a go-users preferences store and returns an admin instance.
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 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 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(r router.Router[*fiber.App], 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 NewViewEngine ¶
NewViewEngine builds a view engine with quickstart sidebar fallbacks.
func RegisterAdminUIRoutes ¶ added in v0.13.0
func RegisterAdminUIRoutes(r router.Router[*fiber.App], 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(r router.Router[*fiber.App], cfg admin.Config, auther *auth.Auther, cookieName string, opts ...AuthUIOption) error
RegisterAuthUIRoutes registers login, logout, and password reset UI routes.
func RegisterOnboardingRoutes ¶ added in v0.19.0
func RegisterOnboardingRoutes(r router.Router[*fiber.App], 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(r router.Router[*fiber.App], cfg admin.Config, opts ...RegistrationUIOption) error
RegisterRegistrationUIRoutes registers the registration UI route.
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 ResolveDiskAssetsDir ¶ added in v0.13.0
ResolveDiskAssetsDir returns the first candidate directory that contains the marker file.
func SeedNavigation ¶
func SeedNavigation(ctx context.Context, opts SeedNavigationOptions) error
SeedNavigation seeds a menu using go-cms cms.SeedMenu.
func SidebarAssetsFS ¶
SidebarAssetsFS returns the embedded sidebar assets (sidebar.js, sidebar.css).
func SidebarTemplatesFS ¶
SidebarTemplatesFS returns the embedded sidebar templates (partials/sidebar.html).
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 ¶
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 ¶
func WithGoAuth(adm *admin.Admin, routeAuth *auth.RouteAuthenticator, cfg auth.Config, authz admin.GoAuthAuthorizerConfig, authCfg *admin.AuthConfig, opts ...admin.GoAuthAuthenticatorOption) (*admin.GoAuthAuthenticator, *admin.GoAuthAuthorizer)
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 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.
Types ¶
type AdapterFlags ¶
AdapterFlags captures adapter switches (config or env).
func ResolveAdapterFlags ¶
func ResolveAdapterFlags() AdapterFlags
ResolveAdapterFlags reads environment toggles.
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
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) based on env flags 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 ¶
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 WithDebugFromEnv ¶ added in v0.15.0
func WithDebugFromEnv(opts ...DebugEnvOption) AdminConfigOption
WithDebugFromEnv maps ADMIN_DEBUG* environment variables into the admin config.
func WithNavMenuCode ¶
func WithNavMenuCode(code string) AdminConfigOption
WithNavMenuCode overrides the default navigation menu code.
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 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 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.
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
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.ScopeSet) 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 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 WithDashboardTemplatesFS ¶
func WithDashboardTemplatesFS(fsys fs.FS) DashboardRendererOption
WithDashboardTemplatesFS appends a template filesystem to the renderer.
type DebugEnvOption ¶ added in v0.15.0
type DebugEnvOption struct {
EnabledKey string
AllowedIPsKey string
CaptureSQLKey string
CaptureLogsKey string
ToolbarModeKey string
ToolbarPanelsKey string
}
DebugEnvOption customizes which environment variables map to debug config.
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 ExportTemplateOption ¶ added in v0.13.0
type ExportTemplateOption func(*exportTemplateOptions)
ExportTemplateOption customizes the default export template renderers.
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 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 FiberServerOption ¶
type FiberServerOption func(*fiberServerOptions)
FiberServerOption customizes the Fiber server defaults.
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.
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 (s *GoUsersPreferencesStore) Delete(ctx context.Context, input admin.PreferencesDeleteInput) error
func (*GoUsersPreferencesStore) Resolve ¶
func (s *GoUsersPreferencesStore) Resolve(ctx context.Context, input admin.PreferencesResolveInput) (admin.PreferenceSnapshot, error)
func (*GoUsersPreferencesStore) Upsert ¶
func (s *GoUsersPreferencesStore) Upsert(ctx context.Context, input admin.PreferencesUpsertInput) (admin.PreferenceSnapshot, error)
type ModuleRegistrarOption ¶
type ModuleRegistrarOption func(*moduleRegistrarOptions)
ModuleRegistrarOption customizes module registration behavior.
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.
type MultiFS ¶
MultiFS tries each filesystem in order until one succeeds.
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 PermissionDefinition ¶
PermissionDefinition describes a permission entry for registration.
func PreferencesPermissions ¶
func PreferencesPermissions() []PermissionDefinition
PreferencesPermissions returns the default permissions for preferences.
type PermissionRegisterFunc ¶
type PermissionRegisterFunc func(def PermissionDefinition) error
PermissionRegisterFunc registers a permission definition with a host registry.
type PlacementConfig ¶
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 PreferencesOption ¶
type PreferencesOption func(*preferencesOptions)
PreferencesOption customizes NewAdminWithGoUsersPreferences behavior.
func EnableFeature ¶
func EnableFeature(feature admin.FeatureKey) PreferencesOption
EnableFeature enables a single admin feature key.
func EnablePreferences ¶
func EnablePreferences() PreferencesOption
EnablePreferences enables the preferences feature gate.
func WithPreferencesAdapterHooks ¶
func WithPreferencesAdapterHooks(hooks AdapterHooks) PreferencesOption
WithPreferencesAdapterHooks sets adapter hooks used by NewAdminWithGoUsersPreferences.
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 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 SecureLinkConfigFromEnv ¶ added in v0.19.0
func SecureLinkConfigFromEnv(basePath string) SecureLinkConfig
SecureLinkConfigFromEnv builds a securelink config from environment variables.
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
SecureLinkUIConfig exposes link parsing details for templates.
func SecureLinkUIConfigFromEnv ¶ added in v0.19.0
func SecureLinkUIConfigFromEnv(basePath string) SecureLinkUIConfig
SecureLinkUIConfigFromEnv reads securelink parsing defaults from env.
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 SeedNavigationOptions ¶
type SeedNavigationOptions struct {
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"`
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 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 SharedActivitySinks ¶ added in v0.19.0
type SharedActivitySinks struct {
}
SharedActivitySinks bundles the admin + go-auth adapters.
func NewSharedActivitySinks ¶ added in v0.19.0
func NewSharedActivitySinks(primary admin.ActivitySink, hooks dashboardactivity.Hooks, cfg dashboardactivity.Config, opts ...GoAuthActivitySinkOption) SharedActivitySinks
NewSharedActivitySinks builds a shared activity sink for admin/go-users/go-auth.
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 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 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 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 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 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.
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 WithUserMigrationsValidationTargets ¶ added in v0.19.0
func WithUserMigrationsValidationTargets(targets ...string) UserMigrationsOption
WithUserMigrationsValidationTargets overrides validation targets used by go-persistence-bun.
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 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.
Source Files
¶
- activity_shared.go
- activity_sink.go
- adapters.go
- admin_bootstrap.go
- admin_config.go
- asset_probe.go
- auth.go
- auth_ui.go
- auth_ui_context.go
- dashboard_renderer.go
- dashboard_templates.go
- debug.go
- error_fiber.go
- export_async.go
- export_bundle.go
- export_renderers.go
- feature_gate.go
- feature_helpers.go
- fiber_server.go
- form_generator.go
- fs.go
- go_users_preferences.go
- menu_scaffolder.go
- module_registrar.go
- nav_helpers.go
- navigation.go
- onboarding_routes.go
- preferences_permissions.go
- preferences_quickstart.go
- registration_ui.go
- securelink.go
- session.go
- sidebar_embed.go
- static_assets.go
- template_funcs.go
- theme_selector.go
- theme_view.go
- ui_routes.go
- user_migrations.go
- util.go
- view_engine.go