Add the event service

This commit is contained in:
Achim Rohn
2025-11-16 19:54:42 +01:00
parent bcc5c7493d
commit 049fefed75
26 changed files with 2656 additions and 9 deletions
+6
View File
@@ -1,6 +1,7 @@
package ersteller
import (
"context"
"encoding/json"
"fmt"
"net/http"
@@ -37,6 +38,7 @@ type HtmxContext interface {
GetAllRoutes() []HtmxRoute
GetQueryParams() []HtmxPathParam
GetAuthContext() (bool, AuthContext)
GetGoContext() context.Context
}
type HtmxContextImpl struct {
@@ -48,6 +50,10 @@ type HtmxContextImpl struct {
routes []HtmxRoute
}
func (c *HtmxContextImpl) GetGoContext() context.Context {
return c.req.Context()
}
func (c *HtmxContextImpl) GetAuthContext() (bool, AuthContext) {
authCtx := c.req.Context().Value(AuthContextKey)
if authCtx == nil {