Documentation
¶
Index ¶
- func HandlerWithContext(ctx context.Context, handler http.Handler) http.Handler
- func WriteError(w http.ResponseWriter, req *http.Request, err error)
- func WriteJSON(w http.ResponseWriter, req *http.Request, status int, v any)
- func WriteString(w http.ResponseWriter, status int, s string)
- type HostAllowListHandler
- type SSEWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerWithContext ¶
TODO: Refactor this in to multiple middlewares.
func WriteError ¶
func WriteError(w http.ResponseWriter, req *http.Request, err error)
func WriteString ¶
func WriteString(w http.ResponseWriter, status int, s string)
Types ¶
type HostAllowListHandler ¶
HostAllowListHandler is an http handler designed to guard against DNS rebinding by rejecting requests that do not come with a whitelisted Host header.
func (*HostAllowListHandler) ServeHTTP ¶
func (h *HostAllowListHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type SSEWriter ¶
type SSEWriter struct {
// contains filtered or unexported fields
}
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
func StartSSE ¶
func StartSSE(w http.ResponseWriter) *SSEWriter
Click to show internal directories.
Click to hide internal directories.