Documentation
¶
Overview ¶
Package dashboard provides the web UI and HTTP API server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexHandler ¶
IndexHandler serves the embedded dashboard HTML/JS/CSS.
Types ¶
type Config ¶
type Config struct {
Addr string // ":8081"
APIKey string // required for POST /api/v1/logs
LogLevel string // "INFO"
BufferSize int // optional (default 5000)
ReadLimit int // optional (default 500)
SERetryMs int // optional (default 2000) - SSE client retry hint
RateRPS float64 // optional (default 50)
RateBurst float64 // optional (default 100)
WriteTimeout int // optional (default 0 = no timeout) - HTTP write timeout in seconds
Version string // optional - dashboard version for logging
}
Config holds the dashboard server configuration.
type EventBroadcaster ¶ added in v0.2.8
EventBroadcaster defines the interface for broadcasting events to connected clients. Allows swapping SSE implementation or adding WebSocket support.
type LogEntry ¶
type LogEntry struct {
ID int64 `json:"id,omitempty"`
Time time.Time `json:"time"`
Message string `json:"msg"`
Fields json.RawMessage `json:"fields,omitempty"`
RemoteIP string `json:"remote_ip,omitempty"`
// Flattened (derived from Fields for API / SSE convenience)
Action string `json:"action,omitempty"`
SourceIP string `json:"source_ip,omitempty"`
SourcePort int `json:"source_port,omitempty"`
DestinationIP string `json:"destination_ip,omitempty"`
DestinationPort int `json:"destination_port,omitempty"`
Protocol string `json:"protocol,omitempty"`
PolicyHit string `json:"policy_hit,omitempty"`
PayloadLen int `json:"payload_len,omitempty"`
HTTPS string `json:"https,omitempty"`
HTTPHost string `json:"http_host,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
FlowID string `json:"flow_id,omitempty"`
Hostname string `json:"hostname,omitempty"`
Src string `json:"src,omitempty"`
Dst string `json:"dst,omitempty"`
Version string `json:"version,omitempty"`
}
LogEntry represents a single ingested or synthetic log event.
type LogStore ¶ added in v0.2.8
type LogStore interface {
Insert(ctx context.Context, e *LogEntry) (int64, error)
Query(ctx context.Context, q string, sinceID int64, limit int) ([]LogEntry, error)
Clear(ctx context.Context) error
}
LogStore defines the interface for log storage backends. Allows swapping between in-memory, database, or other implementations.
type RateLimiter ¶ added in v0.2.8
RateLimiter defines the interface for rate limiting strategies. Allows swapping between token bucket, sliding window, or external services.
Click to show internal directories.
Click to hide internal directories.