Documentation
¶
Index ¶
- func MaxBodySize(maxBytes int64) func(http.Handler) http.Handler
- func NewRouter(orgSvc *services.OrganizationService, entitySvc *services.EntityService, ...) chi.Router
- func RateLimitByIP(requestsPerMinute int) func(http.Handler) http.Handler
- func RecoverPanic(next http.Handler) http.Handler
- func RequireAdmin(next http.Handler) http.Handler
- func SecurityHeaders(next http.Handler) http.Handler
- func StaticFileServer() (http.Handler, error)
- type SSEHandler
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxBodySize ¶ added in v0.0.18
MaxBodySize limits the request body to the given number of bytes.
func NewRouter ¶
func NewRouter( orgSvc *services.OrganizationService, entitySvc *services.EntityService, natsEmbedded *embeddednats.EmbeddedNATS, sseHandler *SSEHandler, mtxClient *mediamtx.Client, apiHandler http.Handler, sessionAuth *apimiddleware.SessionAuth, authSvc *services.AuthService, userSvc *services.UserService, inviteSvc *services.InviteService, apiKeySvc *services.APIKeyService, ) chi.Router
func RateLimitByIP ¶ added in v0.0.18
RateLimitByIP returns middleware that limits requests per IP address using a fixed-window counter. Stale entries are cleaned up lazily during requests.
func RecoverPanic ¶ added in v0.0.18
RecoverPanic recovers from panics in HTTP handlers, logs the stack trace, and returns a 500 response instead of crashing the process.
func RequireAdmin ¶ added in v0.0.18
RequireAdmin is middleware that checks for the admin role in the request context. Must be used after session authentication middleware.
func SecurityHeaders ¶ added in v0.0.18
SecurityHeaders adds security response headers to all responses.
func StaticFileServer ¶ added in v0.0.5
StaticFileServer returns an http.Handler that serves embedded static files. Returns an error instead of panicking if the embedded filesystem is invalid.
Types ¶
type SSEHandler ¶
type SSEHandler struct {
// contains filtered or unexported fields
}
SSEHandler handles Server-Sent Events streaming
func NewSSEHandler ¶
func NewSSEHandler(nc *nats.Conn, js nats.JetStreamContext) *SSEHandler
NewSSEHandler creates a new SSE handler
func (*SSEHandler) StreamMessages ¶
func (h *SSEHandler) StreamMessages(w http.ResponseWriter, r *http.Request)
StreamMessages streams NATS messages to the client via SSE
func (*SSEHandler) StreamMessagesWithFilter ¶
func (h *SSEHandler) StreamMessagesWithFilter(w http.ResponseWriter, r *http.Request)
StreamMessagesWithFilter streams filtered NATS messages
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(dbService *db.Service, nc *nats.Conn, natsEmbedded *embeddednats.EmbeddedNATS, apiHandler http.Handler) (*Server, error)
NewServer creates a new web server instance
func NewWebService ¶
func NewWebService(dbService *db.Service, nc *nats.Conn, natsEmbedded *embeddednats.EmbeddedNATS, apiHandler http.Handler) (*Server, error)
NewWebService creates a new web service with environment-based configuration
func (*Server) HandleHealthCheck ¶
func (s *Server) HandleHealthCheck(w http.ResponseWriter, r *http.Request)
HandleHealthCheck handles the health check endpoint
func (*Server) HealthCheck ¶
HealthCheck returns the health status of the web service (implements Service interface)
Directories
¶
| Path | Synopsis |
|---|---|
|
components
|
|
|
icon
templui component icon - version: v0.101.0 installed by templui v0.101.0 📚 Documentation: https://templui.io/docs/components/icon
|
templui component icon - version: v0.101.0 installed by templui v0.101.0 📚 Documentation: https://templui.io/docs/components/icon |
|
features
|
|
|
admin/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
auth/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
common/components
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
common/icons
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
common/layouts
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
dev
Package dev provides development-only features like hot reload.
|
Package dev provides development-only features like hot reload. |
|
fleet/components
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
fleet/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
map/components
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
map/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
metrics/components
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
metrics/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
organizations/components
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
organizations/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
overwatch/components
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
overwatch/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
streams/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
video/pages
templ: version: v0.3.977
|
templ: version: v0.3.977 |
|
Package signals provides typed signal structs for Datastar SSE communication.
|
Package signals provides typed signal structs for Datastar SSE communication. |
|
templui util templui.go - version: v0.101.0 installed by templui v0.101.0
|
templui util templui.go - version: v0.101.0 installed by templui v0.101.0 |