routes

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(
	authHandler AuthSurface,
	firstLoginHandler FirstLoginSurface,
	notificationHandler *handlers.NotificationHandler,
	userManagementHandler UserManagementSurface,
	profileHandler ProfileSurface,
	contentHandler *handlers.ContentHandler,
	mediaHandler MediaBrowserHandler,
	dashboardHandler *handlers.DashboardHandler,
	seoHandler SEOSurface,
	commentHandler CommentBrowserHandler,
	profilePictureHandler ProfilePictureSurface,
	wordPressHandler WordPressSurface,
	apiKeyHandler *handlers.APIKeyHandler,
	hugoHandler HugoSurface,
	exportHandler *handlers.ExportHandler,
	ssgHandler SSGSurface,
	configExtras func() map[string]any,
	apiKeyAuthMiddleware *middleware.APIKeyAuthMiddleware,
	agentContentHandler *agent.ContentHandler,
	agentMediaHandler MediaAgentHandler,
	agentCommentHandler CommentAgentHandler,
	adminMiddleware *middleware.AdminMiddleware,
	corsMiddleware *middleware.CORSMiddleware,
	noCookieMiddleware *middleware.NoCookieMiddleware,
	csrfMiddleware *middleware.CSRFMiddleware,
	rateLimitMiddleware *middleware.RateLimitMiddleware,
	securityHeadersMiddleware *middleware.SecurityHeadersMiddleware,
	authMiddleware *middleware.AuthMiddleware,
	spaHandler AdminPanelSurface,
	staticHandler http.Handler,
	imageGenEnabled bool,
	imageReferenceEnabled bool,
	textGenEnabled bool,
	textGenHandler TextGenSurface,
	themGenEnabled bool,
	themGenHandler ThemGenSurface,
	plugGenEnabled bool,
	plugGenHandler PlugGenSurface,
	plugGenBuildEnabled bool,
	modGenEnabled bool,
	modGenHandler ModGenSurface,
	modGenApplyEnabled bool,
	themeValidationFailed bool,
	speechEnabled bool,
	speechHandler SpeechSurface,
	languages []string,
	aliasRedirectHandler *handlers.AliasRedirectHandler,
	headlessEnabled bool,
	mcpEnabled bool,
	commentsEnabled bool,
	storageDriver string,
	authorize kernel.CapabilityResolver,
	moduleRegistry *kernel.Registry,
) *chi.Mux

Setup configures and returns the HTTP router

Types

type AdminPanelSurface added in v1.0.0

type AdminPanelSurface interface {
	ServeAdmin(http.ResponseWriter, *http.Request)
}

AdminPanelSurface is the admin SPA surface the routes mount. It is satisfied by the adminpanel module's SPA handler; the structural seam keeps routes.go from importing the module so the surface stays removable. A nil handler unmounts the /admin premises entirely, mirroring the pre-module static-server behavior the headless tests pin.

type AuthSurface added in v1.0.0

type AuthSurface interface {
	Login(http.ResponseWriter, *http.Request)
	VerifyMFA(http.ResponseWriter, *http.Request)
	ResendMFA(http.ResponseWriter, *http.Request)
	RegisterUser(http.ResponseWriter, *http.Request)
	VerifyEmail(http.ResponseWriter, *http.Request)
	ResendVerificationEmail(http.ResponseWriter, *http.Request)
	ForgotPassword(http.ResponseWriter, *http.Request)
	ResetPassword(http.ResponseWriter, *http.Request)
	Logout(http.ResponseWriter, *http.Request)
}

AuthSurface is the public auth surface the routes mount: login (including the emailed-code second step), registration, verification, password reset, and session logout. It is satisfied by the auth module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable.

type CommentAgentHandler added in v1.0.0

type CommentAgentHandler interface {
	Create(http.ResponseWriter, *http.Request)
	List(http.ResponseWriter, *http.Request)
	Delete(http.ResponseWriter, *http.Request)
	UpdateStatus(http.ResponseWriter, *http.Request)
}

CommentAgentHandler is the Bearer-realm (API key) comment surface the routes mount. It is satisfied by the comments module's agent handler, for the same removability reason as CommentBrowserHandler.

type CommentBrowserHandler added in v1.0.0

type CommentBrowserHandler interface {
	GetComments(http.ResponseWriter, *http.Request)
	CreateComment(http.ResponseWriter, *http.Request)
	GetCommentsForModeration(http.ResponseWriter, *http.Request)
	GetPendingComments(http.ResponseWriter, *http.Request)
	UpdateCommentStatus(http.ResponseWriter, *http.Request)
	DeleteComment(http.ResponseWriter, *http.Request)
	GetMyComments(http.ResponseWriter, *http.Request)
	DeleteOwnComment(http.ResponseWriter, *http.Request)
}

CommentBrowserHandler is the browser-realm (JWT/CSRF) comment surface the routes mount. It is satisfied by the comments module's browser handler; the structural seam keeps routes.go from importing the module so the surface stays removable. Method values (handler.GetComments, ...) mount directly.

type FirstLoginSurface added in v1.0.0

type FirstLoginSurface interface {
	GetStatus(http.ResponseWriter, *http.Request)
	CompleteSetup(http.ResponseWriter, *http.Request)
}

FirstLoginSurface is the first-login bootstrap surface the routes mount. Same structural contract as the auth surface.

type HugoSurface added in v1.0.0

type HugoSurface interface {
	Import(http.ResponseWriter, *http.Request)
	ImportStatus(http.ResponseWriter, *http.Request)
}

HugoSurface is the browser-and-agent Hugo import surface the routes mount. Same dual-realm sharing contract as the WordPress surface.

type MediaAgentHandler added in v1.0.0

type MediaAgentHandler interface {
	Upload(http.ResponseWriter, *http.Request)
	List(http.ResponseWriter, *http.Request)
	Get(http.ResponseWriter, *http.Request)
	Delete(http.ResponseWriter, *http.Request)
	Reencode(http.ResponseWriter, *http.Request)
}

MediaAgentHandler is the Bearer-realm (API key) media surface the routes mount. It is satisfied by the media module's agent handler, for the same removability reason as MediaBrowserHandler.

type MediaBrowserHandler added in v1.0.0

type MediaBrowserHandler interface {
	Upload(http.ResponseWriter, *http.Request)
	GetMedia(http.ResponseWriter, *http.Request)
	GetMediaByID(http.ResponseWriter, *http.Request)
	DeleteMedia(http.ResponseWriter, *http.Request)
	GenerateImage(http.ResponseWriter, *http.Request)
}

MediaBrowserHandler is the browser-realm (JWT/CSRF) media surface the routes mount. It is satisfied by the media module's browser handler; the structural seam keeps routes.go from importing the module so the surface stays removable. Method values (handler.GetMedia, ...) mount directly.

type ModGenSurface added in v1.7.0

type ModGenSurface interface {
	Generate(http.ResponseWriter, *http.Request)
	Apply(http.ResponseWriter, *http.Request)
	Unapply(http.ResponseWriter, *http.Request)
	List(http.ResponseWriter, *http.Request)
	Download(http.ResponseWriter, *http.Request)
	Delete(http.ResponseWriter, *http.Request)
}

ModGenSurface is the browser-realm AI module generator surface the routes mount. It is satisfied by the modgen module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable. Only generate stays behind the modGenEnabled feature flag: project management (list/download/delete) needs no AI key and mounts whenever the module wires a handler; the apply leaf additionally requires modGenApplyEnabled.

type PlugGenSurface added in v1.6.0

type PlugGenSurface interface {
	Generate(http.ResponseWriter, *http.Request)
	Build(http.ResponseWriter, *http.Request)
	List(http.ResponseWriter, *http.Request)
	Download(http.ResponseWriter, *http.Request)
	Delete(http.ResponseWriter, *http.Request)
	Status(http.ResponseWriter, *http.Request)
}

PlugGenSurface is the browser-realm AI plugin generator surface the routes mount. It is satisfied by the plugingen module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable. Only generate and build stay behind the plugGenEnabled feature flag: project management (list/download/delete) and the installed-plugin status read need no AI key and mount whenever the module wires a handler.

type ProfilePictureSurface added in v1.0.0

type ProfilePictureSurface interface {
	UploadProfilePicture(http.ResponseWriter, *http.Request)
	DeleteProfilePicture(http.ResponseWriter, *http.Request)
	AdminUploadUserPicture(http.ResponseWriter, *http.Request)
	AdminDeleteUserPicture(http.ResponseWriter, *http.Request)
}

ProfilePictureSurface is the profile picture surface the routes mount: self-service upload/delete plus the admin per-user endpoints. Same structural contract as the management surface.

type ProfileSurface added in v1.0.0

type ProfileSurface interface {
	GetProfile(http.ResponseWriter, *http.Request)
	UpdateEmail(http.ResponseWriter, *http.Request)
	ChangePassword(http.ResponseWriter, *http.Request)
	ExportUserData(http.ResponseWriter, *http.Request)
	VerifyEmailUpdate(http.ResponseWriter, *http.Request)
	DeleteAccount(http.ResponseWriter, *http.Request)
	UpdateCustomFields(http.ResponseWriter, *http.Request)
	UpdateName(http.ResponseWriter, *http.Request)
	GetUserFields(http.ResponseWriter, *http.Request)
}

ProfileSurface is the self-service profile surface the routes mount. Same structural contract as the management surface.

type SEOSurface added in v1.0.0

type SEOSurface interface {
	GetSitemapXML(http.ResponseWriter, *http.Request)
	GetRobotsTxt(http.ResponseWriter, *http.Request)
	GetSitemapData(http.ResponseWriter, *http.Request)
}

SEOSurface is the SEO discovery surface the routes mount: the crawler XML sitemap, robots.txt, and the programmatic JSON sitemap. It is satisfied by the seo module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable.

type SSGSurface added in v1.1.0

type SSGSurface interface {
	Generate(http.ResponseWriter, *http.Request)
}

SSGSurface is the static-site-generation surface the routes mount. It is satisfied by the blog edition's SSG handler; the structural seam keeps routes.go from importing the generator so editions without the SSR engine (nil surface) unmount the export endpoints.

type SpeechSurface added in v1.2.1

type SpeechSurface interface {
	Transcribe(http.ResponseWriter, *http.Request)
}

SpeechSurface is the browser-realm voice-dictation surface the routes mount. It is satisfied by the speech module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable. The speechEnabled feature flag gates mounting.

type TextGenSurface added in v1.0.0

type TextGenSurface interface {
	Enhance(http.ResponseWriter, *http.Request)
	Translate(http.ResponseWriter, *http.Request)
}

TextGenSurface is the browser-realm AI text generation surface the routes mount. It is satisfied by the textgen module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable. The textGenEnabled feature flag gates mounting.

type ThemGenSurface added in v1.5.0

type ThemGenSurface interface {
	Generate(http.ResponseWriter, *http.Request)
	List(http.ResponseWriter, *http.Request)
	Download(http.ResponseWriter, *http.Request)
	Activate(http.ResponseWriter, *http.Request)
	Deactivate(http.ResponseWriter, *http.Request)
	Delete(http.ResponseWriter, *http.Request)
	Preview(http.ResponseWriter, *http.Request)
	PreviewStatus(http.ResponseWriter, *http.Request)
	Snapshot(http.ResponseWriter, *http.Request)
	StopPreview(http.ResponseWriter, *http.Request)
}

ThemGenSurface is the browser-realm AI theme generator surface the routes mount. It is satisfied by the themegen module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable. Only the generate leaf stays behind the themGenEnabled feature flag: theme management (list/download/activate/deactivate/snapshot) needs no AI key and mounts whenever the module wires a handler.

type UserManagementSurface added in v1.0.0

type UserManagementSurface interface {
	GetPendingUsers(http.ResponseWriter, *http.Request)
	ApproveUser(http.ResponseWriter, *http.Request)
	RejectUser(http.ResponseWriter, *http.Request)
	MarkUserAsSpam(http.ResponseWriter, *http.Request)
	GetAllUsers(http.ResponseWriter, *http.Request)
	SuspendUser(http.ResponseWriter, *http.Request)
	UnsuspendUser(http.ResponseWriter, *http.Request)
	SoftDeleteUser(http.ResponseWriter, *http.Request)
	GetSoftDeletedContent(http.ResponseWriter, *http.Request)
	RestoreContent(http.ResponseWriter, *http.Request)
	CreateUser(http.ResponseWriter, *http.Request)
	UpdateUser(http.ResponseWriter, *http.Request)
}

UserManagementSurface is the admin user-lifecycle surface the routes mount: approval, suspension, soft delete with content restore, and admin creation. It is satisfied by the users module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable.

type WordPressSurface added in v1.0.0

type WordPressSurface interface {
	Import(http.ResponseWriter, *http.Request)
	ImportStatus(http.ResponseWriter, *http.Request)
}

WordPressSurface is the browser-and-agent WordPress import surface the routes mount. It is satisfied by the importers module's handler; the structural seam keeps routes.go from importing the module so the surface stays removable. The same instance serves both realms, sharing one in-memory job store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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