Add the event service
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user