Documentation
¶
Index ¶
- func CountWorkerGoroutines() int
- func ForwardLines(ctx context.Context, hub *Hub, lines <-chan string)
- func ForwardLogJSON(ctx context.Context, hub *Hub, logs <-chan LogMessage)
- func ForwardLogJSONBatched(ctx context.Context, hub *Hub, logs <-chan LogMessage, maxBatch int, ...)
- func NormalizeContainerLine(raw string) (level string, msg string, timestamp string)
- func NormalizeProjectLine(raw string) (level, service, msg, timestamp string)
- func NowRFC3339() string
- func ProxyHTTP(w http.ResponseWriter, r *http.Request, remoteWS string, header http.Header) error
- func ServeClient(ctx context.Context, hub *Hub, conn *websocket.Conn)
- type Client
- type Hub
- type LogMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountWorkerGoroutines ¶
func CountWorkerGoroutines() int
CountWorkerGoroutines returns a best-effort count of websocket worker goroutines belonging to this package. Intended for diagnostics endpoints only.
func ForwardLines ¶
ForwardLines forwards plain text lines to the hub.
func ForwardLogJSON ¶
func ForwardLogJSON(ctx context.Context, hub *Hub, logs <-chan LogMessage)
ForwardLogJSON sends each LogMessage as its own JSON object frame.
func ForwardLogJSONBatched ¶
func ForwardLogJSONBatched(ctx context.Context, hub *Hub, logs <-chan LogMessage, maxBatch int, flushInterval time.Duration)
ForwardLogJSONBatched batches log messages into a JSON array frame to reduce frame count. Flushes when maxBatch reached or flushInterval elapsed.
func NormalizeContainerLine ¶
NormalizeContainerLine parses a raw container log line into level + cleaned message. It extracts Docker's timestamp if present (when timestamps=true in Docker API).
func NormalizeProjectLine ¶
NormalizeProjectLine additionally extracts service (pattern: service | message). Returns level, service, message, timestamp (RFC3339Nano) — timestamp may be empty.
func NowRFC3339 ¶
func NowRFC3339() string
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a single WebSocket connection.
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
func (*Hub) ClientCount ¶
func (*Hub) SetOnEmpty ¶
func (h *Hub) SetOnEmpty(fn func())