Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connected websocket client
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub manages websocket connections and fans out log messages
func (*Hub) Broadcast ¶
func (h *Hub) Broadcast(msg LogMessage)
Broadcast sends a log message to all subscribed clients
func (*Hub) WSHandler ¶
func (h *Hub) WSHandler() gin.HandlerFunc
WSHandler creates a gin handler for websocket connections
type LogMessage ¶
type LogMessage struct {
Timestamp string `json:"timestamp"`
Service string `json:"service"`
Level string `json:"level"`
Message string `json:"message"`
Host string `json:"host"`
Attributes map[string]any `json:"attributes,omitempty"`
}
LogMessage represents a log entry sent to websocket clients
type SubscriptionFilter ¶
type SubscriptionFilter struct {
Hosts []string `json:"hosts,omitempty"`
Services []string `json:"services,omitempty"`
}
SubscriptionFilter defines what logs a client wants to receive
Click to show internal directories.
Click to hide internal directories.