Documentation
¶
Index ¶
- func Setup(authHandler AuthSurface, firstLoginHandler FirstLoginSurface, ...) *chi.Mux
- type AdminPanelSurface
- type AuthSurface
- type CommentAgentHandler
- type CommentBrowserHandler
- type FirstLoginSurface
- type HugoSurface
- type MediaAgentHandler
- type MediaBrowserHandler
- type ProfilePictureSurface
- type ProfileSurface
- type SEOSurface
- type TextGenSurface
- type UserManagementSurface
- type WordPressSurface
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 *handlers.SSGHandler, 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, jwtManager *auth.JWTManager, spaHandler AdminPanelSurface, staticHandler http.Handler, imageGenEnabled bool, imageReferenceEnabled bool, textGenEnabled bool, textGenHandler TextGenSurface, languages []string, aliasRedirectHandler *handlers.AliasRedirectHandler, headlessEnabled 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)
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)
}
AuthSurface is the public auth surface the routes mount: login, registration, verification, and password reset. 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)
}
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 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 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 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.