dashboard

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationFunction

type AggregationFunction string

AggregationFunction defines aggregation functions

const (
	AggSum   AggregationFunction = "sum"
	AggAvg   AggregationFunction = "average"
	AggMin   AggregationFunction = "min"
	AggMax   AggregationFunction = "max"
	AggCount AggregationFunction = "count"
	AggP95   AggregationFunction = "p95"
	AggP99   AggregationFunction = "p99"
)

type Alert

type Alert struct {
	ID          string                 `json:"id"`
	Title       string                 `json:"title"`
	Message     string                 `json:"message"`
	Severity    AlertSeverity          `json:"severity"`
	Source      string                 `json:"source"`
	TriggeredAt time.Time              `json:"triggered_at"`
	ResolvedAt  *time.Time             `json:"resolved_at,omitempty"`
	Status      AlertStatus            `json:"status"`
	Actions     []AlertAction          `json:"actions"`
	Metadata    map[string]interface{} `json:"metadata"`
}

Alert represents a dashboard alert

type AlertAction

type AlertAction struct {
	Type        string                 `json:"type"`
	Description string                 `json:"description"`
	Executed    bool                   `json:"executed"`
	Result      string                 `json:"result,omitempty"`
	Metadata    map[string]interface{} `json:"metadata"`
}

AlertAction represents an alert action

type AlertChannel

type AlertChannel struct {
	ID      string      `json:"id"`
	Name    string      `json:"name"`
	Type    ChannelType `json:"type"`
	Config  interface{} `json:"config"`
	Enabled bool        `json:"enabled"`
}

AlertChannel represents an alert notification channel

type AlertRule

type AlertRule struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Condition   string                 `json:"condition"`
	Severity    AlertSeverity          `json:"severity"`
	Actions     []string               `json:"actions"`
	Cooldown    time.Duration          `json:"cooldown"`
	Enabled     bool                   `json:"enabled"`
	LastFired   *time.Time             `json:"last_fired,omitempty"`
	Metadata    map[string]interface{} `json:"metadata"`
}

AlertRule defines alert triggering rules

type AlertSeverity

type AlertSeverity string

AlertSeverity defines alert severity levels

const (
	AlertCritical AlertSeverity = "critical"
	AlertHigh     AlertSeverity = "high"
	AlertMedium   AlertSeverity = "medium"
	AlertLow      AlertSeverity = "low"
	AlertInfo     AlertSeverity = "info"
)

type AlertStatus

type AlertStatus string

AlertStatus defines alert status

const (
	AlertActive       AlertStatus = "active"
	AlertAcknowledged AlertStatus = "acknowledged"
	AlertResolved     AlertStatus = "resolved"
	AlertSuppressed   AlertStatus = "suppressed"
)

type AlertSystem

type AlertSystem struct {
	// contains filtered or unexported fields
}

AlertSystem manages dashboard alerts

func NewAlertSystem

func NewAlertSystem() *AlertSystem

NewAlertSystem creates a new alert system

func (*AlertSystem) TriggerAlert

func (as *AlertSystem) TriggerAlert(rule *AlertRule, message string) *Alert

TriggerAlert triggers a new alert

type Annotation

type Annotation struct {
	Type     string      `json:"type"`
	Position interface{} `json:"position"`
	Text     string      `json:"text"`
	Style    string      `json:"style"`
}

Annotation represents chart annotation

type ChannelType

type ChannelType string

ChannelType defines alert channel types

const (
	ChannelEmail     ChannelType = "email"
	ChannelSlack     ChannelType = "slack"
	ChannelWebhook   ChannelType = "webhook"
	ChannelSMS       ChannelType = "sms"
	ChannelPagerDuty ChannelType = "pagerduty"
)

type Chart

type Chart struct {
	ID         string       `json:"id"`
	Title      string       `json:"title"`
	Type       ChartType    `json:"type"`
	DataSource string       `json:"data_source"`
	Options    ChartOptions `json:"options"`
	LastUpdate time.Time    `json:"last_update"`
	Data       interface{}  `json:"data"`
}

Chart represents a data visualization

type ChartOptions

type ChartOptions struct {
	Width       int                    `json:"width"`
	Height      int                    `json:"height"`
	Colors      []string               `json:"colors"`
	Legend      bool                   `json:"legend"`
	Interactive bool                   `json:"interactive"`
	Annotations []Annotation           `json:"annotations"`
	Custom      map[string]interface{} `json:"custom"`
}

ChartOptions contains chart configuration

type ChartType

type ChartType string

ChartType defines chart types

const (
	ChartLine    ChartType = "line"
	ChartBar     ChartType = "bar"
	ChartPie     ChartType = "pie"
	ChartScatter ChartType = "scatter"
	ChartHeatmap ChartType = "heatmap"
	ChartGauge   ChartType = "gauge"
	ChartTreemap ChartType = "treemap"
	ChartSankey  ChartType = "sankey"
)

type CollectorStatus

type CollectorStatus string

CollectorStatus defines collector status

const (
	CollectorActive CollectorStatus = "active"
	CollectorPaused CollectorStatus = "paused"
	CollectorError  CollectorStatus = "error"
)

type DashboardConfig

type DashboardConfig struct {
	RefreshInterval   time.Duration
	DataRetention     time.Duration
	AlertThresholds   map[string]float64
	EnableForecasting bool
	EnableRealtime    bool
	MaxWidgets        int
}

DashboardConfig holds configuration for executive dashboard

type DashboardOverview

type DashboardOverview struct {
	Timestamp time.Time              `json:"timestamp"`
	Status    string                 `json:"status"`
	Metrics   map[string]interface{} `json:"metrics"`
	Alerts    []*Alert               `json:"alerts"`
	Insights  []*Insight             `json:"insights"`
	Risks     []*Risk                `json:"risks"`
	Score     float64                `json:"security_score"`
}

DashboardOverview contains dashboard overview

type DataPoint

type DataPoint struct {
	Timestamp time.Time              `json:"timestamp"`
	Value     float64                `json:"value"`
	Labels    map[string]string      `json:"labels"`
	Metadata  map[string]interface{} `json:"metadata"`
}

DataPoint represents a data point

type DataVisualizer

type DataVisualizer struct {
	// contains filtered or unexported fields
}

DataVisualizer creates visualizations

func NewDataVisualizer

func NewDataVisualizer() *DataVisualizer

NewDataVisualizer creates a new data visualizer

func (*DataVisualizer) CreateChart

func (dv *DataVisualizer) CreateChart(chartType ChartType, title string, dataSource string) *Chart

CreateChart creates a new chart

type ExecutiveDashboard

type ExecutiveDashboard struct {
	// contains filtered or unexported fields
}

ExecutiveDashboard provides high-level security insights for LLM red teaming

func NewExecutiveDashboard

func NewExecutiveDashboard(config DashboardConfig) *ExecutiveDashboard

NewExecutiveDashboard creates a new executive dashboard

func (*ExecutiveDashboard) AddWidget

func (ed *ExecutiveDashboard) AddWidget(ctx context.Context, widget *Widget) error

AddWidget adds a widget to the dashboard

func (*ExecutiveDashboard) CreateLayout

func (ed *ExecutiveDashboard) CreateLayout(ctx context.Context, layout *Layout) error

CreateLayout creates a dashboard layout

func (*ExecutiveDashboard) GetOverview

func (ed *ExecutiveDashboard) GetOverview(ctx context.Context) (*DashboardOverview, error)

GetOverview returns dashboard overview

type ExecutiveReport

type ExecutiveReport struct {
	ID         string                 `json:"id"`
	Title      string                 `json:"title"`
	Period     ReportPeriod           `json:"period"`
	Summary    ExecutiveSummary       `json:"summary"`
	Sections   []ReportSection        `json:"sections"`
	Generated  time.Time              `json:"generated"`
	Recipients []string               `json:"recipients"`
	Format     string                 `json:"format"`
	Metadata   map[string]interface{} `json:"metadata"`
}

ExecutiveReport represents an executive report

type ExecutiveReporting

type ExecutiveReporting struct {
	// contains filtered or unexported fields
}

ExecutiveReporting generates executive reports

func NewExecutiveReporting

func NewExecutiveReporting() *ExecutiveReporting

NewExecutiveReporting creates new executive reporting

func (*ExecutiveReporting) GenerateReport

func (er *ExecutiveReporting) GenerateReport(period ReportPeriod) *ExecutiveReport

GenerateReport generates an executive report

type ExecutiveSummary

type ExecutiveSummary struct {
	KeyMetrics      map[string]float64 `json:"key_metrics"`
	Trends          []TrendSummary     `json:"trends"`
	Risks           []RiskSummary      `json:"risks"`
	Achievements    []string           `json:"achievements"`
	Concerns        []string           `json:"concerns"`
	Recommendations []string           `json:"recommendations"`
}

ExecutiveSummary contains executive summary

type Forecast

type Forecast struct {
	ID         string          `json:"id"`
	Metric     string          `json:"metric"`
	Horizon    time.Duration   `json:"horizon"`
	Points     []ForecastPoint `json:"points"`
	Confidence float64         `json:"confidence"`
	Generated  time.Time       `json:"generated"`
}

Forecast represents a trend forecast

type ForecastModel

type ForecastModel struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Type        string                 `json:"type"`
	Parameters  map[string]interface{} `json:"parameters"`
	Accuracy    float64                `json:"accuracy"`
	LastTrained time.Time              `json:"last_trained"`
}

ForecastModel represents a forecasting model

type ForecastPoint

type ForecastPoint struct {
	Timestamp  time.Time `json:"timestamp"`
	Value      float64   `json:"value"`
	Upper      float64   `json:"upper_bound"`
	Lower      float64   `json:"lower_bound"`
	Confidence float64   `json:"confidence"`
}

ForecastPoint represents a forecast point

type GridConfig

type GridConfig struct {
	Columns    int  `json:"columns"`
	Rows       int  `json:"rows"`
	GutterSize int  `json:"gutter_size"`
	Responsive bool `json:"responsive"`
}

GridConfig defines grid configuration

type ImpactLevel

type ImpactLevel string

ImpactLevel defines impact levels

const (
	ImpactCritical ImpactLevel = "critical"
	ImpactHigh     ImpactLevel = "high"
	ImpactMedium   ImpactLevel = "medium"
	ImpactLow      ImpactLevel = "low"
	ImpactMinimal  ImpactLevel = "minimal"
)

type Insight

type Insight struct {
	ID          string                 `json:"id"`
	Title       string                 `json:"title"`
	Description string                 `json:"description"`
	Type        InsightType            `json:"type"`
	Severity    InsightSeverity        `json:"severity"`
	Confidence  float64                `json:"confidence"`
	Evidence    []string               `json:"evidence"`
	Actions     []string               `json:"actions"`
	Generated   time.Time              `json:"generated"`
	ExpiresAt   time.Time              `json:"expires_at"`
	Metadata    map[string]interface{} `json:"metadata"`
}

Insight represents a generated insight

type InsightAnalyzer

type InsightAnalyzer struct {
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Type      string   `json:"type"`
	Metrics   []string `json:"metrics"`
	Algorithm string   `json:"algorithm"`
	Threshold float64  `json:"threshold"`
}

InsightAnalyzer analyzes data for insights

type InsightSeverity

type InsightSeverity string

InsightSeverity defines insight severity

const (
	InsightCritical InsightSeverity = "critical"
	InsightHigh     InsightSeverity = "high"
	InsightMedium   InsightSeverity = "medium"
	InsightLow      InsightSeverity = "low"
)

type InsightType

type InsightType string

InsightType defines insight types

const (
	InsightAnomaly      InsightType = "anomaly"
	InsightTrend        InsightType = "trend"
	InsightPrediction   InsightType = "prediction"
	InsightOptimization InsightType = "optimization"
	InsightCompliance   InsightType = "compliance"
)

type InsightsEngine

type InsightsEngine struct {
	// contains filtered or unexported fields
}

InsightsEngine generates insights

func NewInsightsEngine

func NewInsightsEngine() *InsightsEngine

NewInsightsEngine creates a new insights engine

func (*InsightsEngine) GenerateInsight

func (ie *InsightsEngine) GenerateInsight(analyzer *InsightAnalyzer, data interface{}) *Insight

GenerateInsight generates a new insight

type Layout

type Layout struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Widgets     []string               `json:"widgets"`
	Grid        GridConfig             `json:"grid"`
	Theme       string                 `json:"theme"`
	Metadata    map[string]interface{} `json:"metadata"`
}

Layout represents dashboard layout

type MetricAggregator

type MetricAggregator struct {
	ID       string              `json:"id"`
	Name     string              `json:"name"`
	Metrics  []string            `json:"metrics"`
	Function AggregationFunction `json:"function"`
	Window   time.Duration       `json:"window"`
	Output   string              `json:"output"`
}

MetricAggregator aggregates metrics

type MetricCollector

type MetricCollector struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Type        MetricType             `json:"type"`
	Source      string                 `json:"source"`
	Interval    time.Duration          `json:"interval"`
	LastCollect time.Time              `json:"last_collect"`
	Status      CollectorStatus        `json:"status"`
	Config      map[string]interface{} `json:"config"`
}

MetricCollector collects specific metrics

type MetricStorage

type MetricStorage struct {
	// contains filtered or unexported fields
}

MetricStorage stores metric data

func NewMetricStorage

func NewMetricStorage() *MetricStorage

NewMetricStorage creates new metric storage

func (*MetricStorage) Store

func (ms *MetricStorage) Store(name string, point DataPoint)

Store stores a data point

type MetricType

type MetricType string

MetricType defines metric types

const (
	MetricCounter   MetricType = "counter"
	MetricGauge     MetricType = "gauge"
	MetricHistogram MetricType = "histogram"
	MetricSummary   MetricType = "summary"
)

type MetricsSystem

type MetricsSystem struct {
	// contains filtered or unexported fields
}

MetricsSystem manages dashboard metrics

func NewMetricsSystem

func NewMetricsSystem() *MetricsSystem

NewMetricsSystem creates a new metrics system

func (*MetricsSystem) CollectMetric

func (ms *MetricsSystem) CollectMetric(name string, value float64, labels map[string]string)

CollectMetric collects a metric

type Mitigation

type Mitigation struct {
	ID             string                 `json:"id"`
	Name           string                 `json:"name"`
	Description    string                 `json:"description"`
	Type           MitigationType         `json:"type"`
	Effectiveness  float64                `json:"effectiveness"`
	Cost           float64                `json:"cost"`
	Implementation string                 `json:"implementation"`
	Status         MitigationStatus       `json:"status"`
	Metadata       map[string]interface{} `json:"metadata"`
}

Mitigation represents a risk mitigation

type MitigationStatus

type MitigationStatus string

MitigationStatus defines mitigation status

const (
	MitigationPlanned      MitigationStatus = "planned"
	MitigationImplementing MitigationStatus = "implementing"
	MitigationImplemented  MitigationStatus = "implemented"
	MitigationVerified     MitigationStatus = "verified"
)

type MitigationType

type MitigationType string

MitigationType defines mitigation types

const (
	MitigationPreventive   MitigationType = "preventive"
	MitigationDetective    MitigationType = "detective"
	MitigationCorrective   MitigationType = "corrective"
	MitigationCompensating MitigationType = "compensating"
)

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Position represents widget position

type Renderer

type Renderer interface {
	Render(chart *Chart) ([]byte, error)
}

Renderer interface for chart rendering

type ReportPeriod

type ReportPeriod struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
	Label string    `json:"label"`
}

ReportPeriod defines report period

type ReportScheduler

type ReportScheduler struct {
	// contains filtered or unexported fields
}

ReportScheduler schedules report generation

func NewReportScheduler

func NewReportScheduler() *ReportScheduler

NewReportScheduler creates a new report scheduler

type ReportSection

type ReportSection struct {
	Title    string      `json:"title"`
	Content  interface{} `json:"content"`
	Charts   []string    `json:"charts"`
	Tables   []Table     `json:"tables"`
	Priority int         `json:"priority"`
}

ReportSection represents a report section

type ReportTemplate

type ReportTemplate struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	Sections   []string `json:"sections"`
	Schedule   string   `json:"schedule"`
	Recipients []string `json:"recipients"`
}

ReportTemplate defines report template

type Risk

type Risk struct {
	ID           string                 `json:"id"`
	Name         string                 `json:"name"`
	Description  string                 `json:"description"`
	Category     string                 `json:"category"`
	Likelihood   float64                `json:"likelihood"`
	Impact       ImpactLevel            `json:"impact"`
	Score        float64                `json:"risk_score"`
	Status       RiskStatus             `json:"status"`
	Owner        string                 `json:"owner"`
	Mitigations  []string               `json:"mitigations"`
	LastAssessed time.Time              `json:"last_assessed"`
	Metadata     map[string]interface{} `json:"metadata"`
}

Risk represents a security risk

type RiskAnalyzer

type RiskAnalyzer struct {
	// contains filtered or unexported fields
}

RiskAnalyzer analyzes security risks

func NewRiskAnalyzer

func NewRiskAnalyzer() *RiskAnalyzer

NewRiskAnalyzer creates a new risk analyzer

func (*RiskAnalyzer) AnalyzeRisk

func (ra *RiskAnalyzer) AnalyzeRisk(risk *Risk) float64

AnalyzeRisk analyzes a security risk

type RiskScenario

type RiskScenario struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Triggers    []string               `json:"triggers"`
	Outcomes    []string               `json:"outcomes"`
	Probability float64                `json:"probability"`
	SimResults  map[string]interface{} `json:"simulation_results"`
}

RiskScenario represents a risk scenario

type RiskStatus

type RiskStatus string

RiskStatus defines risk status

const (
	RiskActive      RiskStatus = "active"
	RiskMitigated   RiskStatus = "mitigated"
	RiskAccepted    RiskStatus = "accepted"
	RiskTransferred RiskStatus = "transferred"
)

type RiskSummary

type RiskSummary struct {
	Name       string  `json:"name"`
	Level      string  `json:"level"`
	Likelihood float64 `json:"likelihood"`
	Impact     string  `json:"impact"`
	Mitigation string  `json:"mitigation"`
}

RiskSummary summarizes a risk

type Schedule

type Schedule struct {
	ID        string    `json:"id"`
	Frequency string    `json:"frequency"`
	NextRun   time.Time `json:"next_run"`
	Enabled   bool      `json:"enabled"`
}

Schedule represents a report schedule

type ScoreCategory

type ScoreCategory struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Metrics     []string `json:"metrics"`
	Weight      float64  `json:"weight"`
	Score       float64  `json:"score"`
}

ScoreCategory represents a score category

type ScoreHistory

type ScoreHistory struct {
	Timestamp time.Time `json:"timestamp"`
	Score     float64   `json:"score"`
	Delta     float64   `json:"delta"`
}

ScoreHistory represents score history

type ScoreMetric

type ScoreMetric struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	Category   string    `json:"category"`
	Value      float64   `json:"value"`
	MaxValue   float64   `json:"max_value"`
	Weight     float64   `json:"weight"`
	Trend      string    `json:"trend"`
	LastUpdate time.Time `json:"last_update"`
}

ScoreMetric represents a score metric

type SecurityScorecard

type SecurityScorecard struct {
	// contains filtered or unexported fields
}

SecurityScorecard tracks security metrics

func NewSecurityScorecard

func NewSecurityScorecard() *SecurityScorecard

NewSecurityScorecard creates a new security scorecard

func (*SecurityScorecard) UpdateScore

func (ss *SecurityScorecard) UpdateScore(metricID string, value float64)

UpdateScore updates a score metric

type Size

type Size struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

Size represents widget size

type Table

type Table struct {
	Headers []string   `json:"headers"`
	Rows    [][]string `json:"rows"`
}

Table represents a data table

type Threshold

type Threshold struct {
	Value    float64 `json:"value"`
	Color    string  `json:"color"`
	Label    string  `json:"label"`
	Operator string  `json:"operator"`
}

Threshold represents a widget threshold

type TimeSeries

type TimeSeries struct {
	ID         string        `json:"id"`
	Name       string        `json:"name"`
	Points     []DataPoint   `json:"points"`
	Resolution time.Duration `json:"resolution"`
	Retention  time.Duration `json:"retention"`
}

TimeSeries represents time series data

type TrendForecaster

type TrendForecaster struct {
	// contains filtered or unexported fields
}

TrendForecaster forecasts trends

func NewTrendForecaster

func NewTrendForecaster() *TrendForecaster

NewTrendForecaster creates a new trend forecaster

func (*TrendForecaster) ForecastTrend

func (tf *TrendForecaster) ForecastTrend(metric string, horizon time.Duration) *Forecast

ForecastTrend forecasts a trend

type TrendSummary

type TrendSummary struct {
	Metric    string  `json:"metric"`
	Direction string  `json:"direction"`
	Change    float64 `json:"change"`
	Impact    string  `json:"impact"`
}

TrendSummary summarizes a trend

type Widget

type Widget struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Type        WidgetType             `json:"type"`
	DataSource  string                 `json:"data_source"`
	Config      WidgetConfig           `json:"config"`
	Position    Position               `json:"position"`
	Size        Size                   `json:"size"`
	LastUpdate  time.Time              `json:"last_update"`
	RefreshRate time.Duration          `json:"refresh_rate"`
	Metadata    map[string]interface{} `json:"metadata"`
}

Widget represents a dashboard widget

type WidgetAction

type WidgetAction struct {
	Type    string `json:"type"`
	Label   string `json:"label"`
	Target  string `json:"target"`
	Payload string `json:"payload"`
}

WidgetAction represents a widget action

type WidgetConfig

type WidgetConfig struct {
	Title       string                 `json:"title"`
	Subtitle    string                 `json:"subtitle"`
	ShowLegend  bool                   `json:"show_legend"`
	Interactive bool                   `json:"interactive"`
	Thresholds  []Threshold            `json:"thresholds"`
	Actions     []WidgetAction         `json:"actions"`
	Custom      map[string]interface{} `json:"custom"`
}

WidgetConfig contains widget configuration

type WidgetType

type WidgetType string

WidgetType defines widget types

const (
	WidgetMetric    WidgetType = "metric"
	WidgetChart     WidgetType = "chart"
	WidgetTable     WidgetType = "table"
	WidgetAlert     WidgetType = "alert"
	WidgetScorecard WidgetType = "scorecard"
	WidgetHeatmap   WidgetType = "heatmap"
	WidgetTimeline  WidgetType = "timeline"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL