Documentation
¶
Index ¶
- func CSRFMiddleware(next http.Handler, trustedOrigins ...string) http.Handler
- func ConfigHandler(configPath string) http.HandlerFunc
- func ConfigHandlerWithStore(store *wsserver.Store) http.HandlerFunc
- func DeleteCookie(responseWriter http.ResponseWriter, name string)
- func EventsHandler(configPath string) http.HandlerFunc
- func EventsHandlerWithStore(store *wsserver.Store) http.HandlerFunc
- func IndexHandler(configPath string) http.HandlerFunc
- func IndexHandlerWithStore(store *wsserver.Store) http.HandlerFunc
- func Run(addr string, store *wsserver.Store, trustedOrigins []string, token string) error
- func SecurityHeaders(next http.Handler) http.Handler
- func SendEventData(responseWriter http.ResponseWriter, flusher http.Flusher, configPath string) error
- func SendEventDataFromStore(responseWriter http.ResponseWriter, flusher http.Flusher, ...) error
- func SetSecureCookie(responseWriter http.ResponseWriter, opts SecureCookieOptions)
- func SetStrictCookie(responseWriter http.ResponseWriter, name, value string, maxAge int)
- func SetupSSEHeaders(w http.ResponseWriter)
- func StreamEvents(ctx context.Context, responseWriter http.ResponseWriter, flusher http.Flusher, ...)
- func StreamEventsFromStore(ctx context.Context, responseWriter http.ResponseWriter, flusher http.Flusher, ...)
- type SecureCookieOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigHandler ¶
func ConfigHandler(configPath string) http.HandlerFunc
func ConfigHandlerWithStore ¶
func ConfigHandlerWithStore(store *wsserver.Store) http.HandlerFunc
func DeleteCookie ¶
func DeleteCookie(responseWriter http.ResponseWriter, name string)
func EventsHandler ¶
func EventsHandler(configPath string) http.HandlerFunc
func EventsHandlerWithStore ¶
func EventsHandlerWithStore(store *wsserver.Store) http.HandlerFunc
func IndexHandler ¶
func IndexHandler(configPath string) http.HandlerFunc
func IndexHandlerWithStore ¶
func IndexHandlerWithStore(store *wsserver.Store) http.HandlerFunc
func SendEventData ¶
func SendEventData(responseWriter http.ResponseWriter, flusher http.Flusher, configPath string) error
SendEventData sends a single Server-Sent Event with the current config.
func SendEventDataFromStore ¶
func SetSecureCookie ¶
func SetSecureCookie(responseWriter http.ResponseWriter, opts SecureCookieOptions)
SetSecureCookie sets a secure HTTP cookie with configurable options. Uses SameSite=Lax for CSRF protection while allowing top-level navigation.
func SetStrictCookie ¶
func SetStrictCookie(responseWriter http.ResponseWriter, name, value string, maxAge int)
func SetupSSEHeaders ¶
func SetupSSEHeaders(w http.ResponseWriter)
SetupSSEHeaders sets HTTP headers for Server-Sent Events.
func StreamEvents ¶
func StreamEvents(ctx context.Context, responseWriter http.ResponseWriter, flusher http.Flusher, configPath string)
StreamEvents sends Server-Sent Events periodically until context is done.
func StreamEventsFromStore ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.