Documentation
¶
Overview ¶
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: AGPL-3.0-or-later
Index ¶
- func EmbedDocumentMiddleware(docService docService, publisher webhookPublisher) func(http.Handler) http.Handler
- func EmbedFolder(fsEmbed embed.FS, targetPath string, baseURL string, version string, ...) http.HandlerFunc
- type Server
- func (s *Server) GetAddr() string
- func (s *Server) GetAdminEmails() []string
- func (s *Server) GetAuthService() *auth.OauthService
- func (s *Server) GetDB() *sql.DB
- func (s *Server) GetEmailSender() email.Sender
- func (s *Server) RegisterRoutes(fn func(r *chi.Mux))
- func (s *Server) Router() *chi.Mux
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) Start() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmbedDocumentMiddleware ¶
func EmbedDocumentMiddleware( docService docService, publisher webhookPublisher, ) func(http.Handler) http.Handler
EmbedDocumentMiddleware creates documents on /embed access with strict rate limiting This ensures documents exist before the SPA renders, without requiring authentication The docServiceFn should be a function that calls FindOrCreateDocument
func EmbedFolder ¶
func EmbedFolder(fsEmbed embed.FS, targetPath string, baseURL string, version string, oauthEnabled bool, magicLinkEnabled bool, onlyAdminCanCreate bool, signatureRepo *database.SignatureRepository) http.HandlerFunc
EmbedFolder returns an http.HandlerFunc that serves an embedded filesystem with SPA fallback support (serves index.html for non-existent routes) For index.html, it replaces __ACKIFY_BASE_URL__ placeholder with the actual base URL, __ACKIFY_VERSION__ with the application version, __ACKIFY_OAUTH_ENABLED__ and __ACKIFY_MAGICLINK_ENABLED__ with auth method flags, __ACKIFY_ONLY_ADMIN_CAN_CREATE__ with document creation restriction flag, and __META_TAGS__ with dynamic meta tags based on query parameters
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetAdminEmails ¶
func (*Server) GetAuthService ¶
func (s *Server) GetAuthService() *auth.OauthService