analyze

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	AnalyzeLogs(options LogOptions) (*LogAnalysis, error)
	AnalyzePerformance(options PerformanceOptions) (*PerformanceAnalysis, error)
	AnalyzeCosts(options CostOptions) (*CostAnalysis, error)
	AnalyzeSecurity(options SecurityOptions) (*SecurityAnalysis, error)
	AnalyzeCapacity(options CapacityOptions) (*CapacityAnalysis, error)
}

Analyzer interface defines analysis operations

func New

func New() (Analyzer, error)

New creates a new analyzer instance

type AnalyzerImpl

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

AnalyzerImpl implements the Analyzer interface

func (*AnalyzerImpl) AnalyzeCapacity

func (a *AnalyzerImpl) AnalyzeCapacity(options CapacityOptions) (*CapacityAnalysis, error)

AnalyzeCapacity analyzes capacity and forecasts

func (*AnalyzerImpl) AnalyzeCosts

func (a *AnalyzerImpl) AnalyzeCosts(options CostOptions) (*CostAnalysis, error)

AnalyzeCosts analyzes cloud costs

func (*AnalyzerImpl) AnalyzeLogs

func (a *AnalyzerImpl) AnalyzeLogs(options LogOptions) (*LogAnalysis, error)

AnalyzeLogs analyzes log files

func (*AnalyzerImpl) AnalyzePerformance

func (a *AnalyzerImpl) AnalyzePerformance(options PerformanceOptions) (*PerformanceAnalysis, error)

AnalyzePerformance analyzes performance metrics

func (*AnalyzerImpl) AnalyzeSecurity

func (a *AnalyzerImpl) AnalyzeSecurity(options SecurityOptions) (*SecurityAnalysis, error)

AnalyzeSecurity analyzes security posture

type CapacityAlert

type CapacityAlert struct {
	Resource  string  `json:"resource" yaml:"resource"`
	Type      string  `json:"type" yaml:"type"`
	Severity  string  `json:"severity" yaml:"severity"`
	Message   string  `json:"message" yaml:"message"`
	Threshold float64 `json:"threshold" yaml:"threshold"`
	Current   float64 `json:"current" yaml:"current"`
	Action    string  `json:"action" yaml:"action"`
}

CapacityAlert represents a capacity alert

type CapacityAnalysis

type CapacityAnalysis struct {
	Summary         string             `json:"summary" yaml:"summary"`
	CurrentUsage    []CapacityMetric   `json:"current_usage" yaml:"current_usage"`
	Forecast        []CapacityForecast `json:"forecast" yaml:"forecast"`
	Alerts          []CapacityAlert    `json:"alerts" yaml:"alerts"`
	Recommendations []string           `json:"recommendations" yaml:"recommendations"`
	Metadata        map[string]string  `json:"metadata" yaml:"metadata"`
	Timestamp       time.Time          `json:"timestamp" yaml:"timestamp"`
}

CapacityAnalysis represents capacity analysis results

type CapacityForecast

type CapacityForecast struct {
	Resource       string     `json:"resource" yaml:"resource"`
	Period         string     `json:"period" yaml:"period"`
	Predicted      float64    `json:"predicted" yaml:"predicted"`
	Confidence     float64    `json:"confidence" yaml:"confidence"`
	ExhaustionDate *time.Time `json:"exhaustion_date,omitempty" yaml:"exhaustion_date,omitempty"`
}

CapacityForecast represents capacity forecast

type CapacityMetric

type CapacityMetric struct {
	Resource string  `json:"resource" yaml:"resource"`
	Current  float64 `json:"current" yaml:"current"`
	Maximum  float64 `json:"maximum" yaml:"maximum"`
	Usage    float64 `json:"usage" yaml:"usage"`
	Unit     string  `json:"unit" yaml:"unit"`
	Status   string  `json:"status" yaml:"status"`
	Trend    string  `json:"trend" yaml:"trend"`
}

CapacityMetric represents a capacity metric

type CapacityOptions

type CapacityOptions struct {
	Service  string `json:"service" yaml:"service"`
	Forecast string `json:"forecast" yaml:"forecast"`
}

CapacityOptions represents capacity analysis options

type ComplianceCheck

type ComplianceCheck struct {
	Standard    string `json:"standard" yaml:"standard"`
	Control     string `json:"control" yaml:"control"`
	Status      string `json:"status" yaml:"status"`
	Description string `json:"description" yaml:"description"`
	Impact      string `json:"impact" yaml:"impact"`
	Remediation string `json:"remediation" yaml:"remediation"`
}

ComplianceCheck represents a compliance check result

type CostAnalysis

type CostAnalysis struct {
	Summary         string               `json:"summary" yaml:"summary"`
	TotalCost       float64              `json:"total_cost" yaml:"total_cost"`
	Currency        string               `json:"currency" yaml:"currency"`
	Breakdown       []CostBreakdown      `json:"breakdown" yaml:"breakdown"`
	Trends          []CostTrend          `json:"trends" yaml:"trends"`
	Recommendations []CostRecommendation `json:"recommendations" yaml:"recommendations"`
	Savings         float64              `json:"potential_savings" yaml:"potential_savings"`
	Metadata        map[string]string    `json:"metadata" yaml:"metadata"`
	Timestamp       time.Time            `json:"timestamp" yaml:"timestamp"`
}

CostAnalysis represents cost analysis results

type CostBreakdown

type CostBreakdown struct {
	Category   string  `json:"category" yaml:"category"`
	Cost       float64 `json:"cost" yaml:"cost"`
	Percentage float64 `json:"percentage" yaml:"percentage"`
	Change     float64 `json:"change" yaml:"change"`
	Trend      string  `json:"trend" yaml:"trend"`
}

CostBreakdown represents cost breakdown by service/category

type CostOptions

type CostOptions struct {
	Period          string `json:"period" yaml:"period"`
	Service         string `json:"service" yaml:"service"`
	Recommendations bool   `json:"recommendations" yaml:"recommendations"`
}

CostOptions represents cost analysis options

type CostRecommendation

type CostRecommendation struct {
	Title       string   `json:"title" yaml:"title"`
	Description string   `json:"description" yaml:"description"`
	Savings     float64  `json:"potential_savings" yaml:"potential_savings"`
	Effort      string   `json:"effort" yaml:"effort"`
	Impact      string   `json:"impact" yaml:"impact"`
	Priority    string   `json:"priority" yaml:"priority"`
	Actions     []string `json:"actions" yaml:"actions"`
}

CostRecommendation represents a cost optimization recommendation

type CostTrend

type CostTrend struct {
	Period   string  `json:"period" yaml:"period"`
	Cost     float64 `json:"cost" yaml:"cost"`
	Change   float64 `json:"change" yaml:"change"`
	Forecast string  `json:"forecast" yaml:"forecast"`
}

CostTrend represents cost trend over time

type LogAnalysis

type LogAnalysis struct {
	Summary      string            `json:"summary" yaml:"summary"`
	ErrorCount   int               `json:"error_count" yaml:"error_count"`
	WarningCount int               `json:"warning_count" yaml:"warning_count"`
	Patterns     []LogPattern      `json:"patterns" yaml:"patterns"`
	Anomalies    []LogAnomaly      `json:"anomalies" yaml:"anomalies"`
	Insights     []string          `json:"insights" yaml:"insights"`
	Metadata     map[string]string `json:"metadata" yaml:"metadata"`
	Timestamp    time.Time         `json:"timestamp" yaml:"timestamp"`
}

LogAnalysis represents log analysis results

type LogAnomaly

type LogAnomaly struct {
	Type        string    `json:"type" yaml:"type"`
	Description string    `json:"description" yaml:"description"`
	Severity    string    `json:"severity" yaml:"severity"`
	Timestamp   time.Time `json:"timestamp" yaml:"timestamp"`
	Context     string    `json:"context" yaml:"context"`
}

LogAnomaly represents an anomaly found in logs

type LogOptions

type LogOptions struct {
	File      string `json:"file" yaml:"file"`
	Pattern   string `json:"pattern" yaml:"pattern"`
	TimeRange string `json:"time_range" yaml:"time_range"`
}

LogOptions represents log analysis options

type LogPattern

type LogPattern struct {
	Pattern   string    `json:"pattern" yaml:"pattern"`
	Count     int       `json:"count" yaml:"count"`
	Severity  string    `json:"severity" yaml:"severity"`
	FirstSeen time.Time `json:"first_seen" yaml:"first_seen"`
	LastSeen  time.Time `json:"last_seen" yaml:"last_seen"`
	Examples  []string  `json:"examples" yaml:"examples"`
}

LogPattern represents a pattern found in logs

type PerformanceAnalysis

type PerformanceAnalysis struct {
	Summary         string                  `json:"summary" yaml:"summary"`
	OverallHealth   string                  `json:"overall_health" yaml:"overall_health"`
	Metrics         []PerformanceMetric     `json:"metrics" yaml:"metrics"`
	Bottlenecks     []PerformanceBottleneck `json:"bottlenecks" yaml:"bottlenecks"`
	Recommendations []string                `json:"recommendations" yaml:"recommendations"`
	Trends          []PerformanceTrend      `json:"trends" yaml:"trends"`
	Metadata        map[string]string       `json:"metadata" yaml:"metadata"`
	Timestamp       time.Time               `json:"timestamp" yaml:"timestamp"`
}

PerformanceAnalysis represents performance analysis results

type PerformanceBottleneck

type PerformanceBottleneck struct {
	Component   string  `json:"component" yaml:"component"`
	Description string  `json:"description" yaml:"description"`
	Impact      string  `json:"impact" yaml:"impact"`
	Severity    string  `json:"severity" yaml:"severity"`
	Confidence  float64 `json:"confidence" yaml:"confidence"`
	Solution    string  `json:"solution" yaml:"solution"`
}

PerformanceBottleneck represents a performance bottleneck

type PerformanceMetric

type PerformanceMetric struct {
	Name      string  `json:"name" yaml:"name"`
	Value     float64 `json:"value" yaml:"value"`
	Unit      string  `json:"unit" yaml:"unit"`
	Status    string  `json:"status" yaml:"status"`
	Threshold float64 `json:"threshold" yaml:"threshold"`
	Trend     string  `json:"trend" yaml:"trend"`
}

PerformanceMetric represents a performance metric

type PerformanceOptions

type PerformanceOptions struct {
	Service   string `json:"service" yaml:"service"`
	Metric    string `json:"metric" yaml:"metric"`
	TimeRange string `json:"time_range" yaml:"time_range"`
}

PerformanceOptions represents performance analysis options

type PerformanceTrend

type PerformanceTrend struct {
	Metric    string  `json:"metric" yaml:"metric"`
	Direction string  `json:"direction" yaml:"direction"`
	Rate      float64 `json:"rate" yaml:"rate"`
	Forecast  string  `json:"forecast" yaml:"forecast"`
}

PerformanceTrend represents a performance trend

type SecurityAnalysis

type SecurityAnalysis struct {
	Summary         string                   `json:"summary" yaml:"summary"`
	OverallScore    float64                  `json:"overall_score" yaml:"overall_score"`
	Vulnerabilities []SecurityVulnerability  `json:"vulnerabilities" yaml:"vulnerabilities"`
	Compliance      []ComplianceCheck        `json:"compliance" yaml:"compliance"`
	Recommendations []SecurityRecommendation `json:"recommendations" yaml:"recommendations"`
	RiskLevel       string                   `json:"risk_level" yaml:"risk_level"`
	Metadata        map[string]string        `json:"metadata" yaml:"metadata"`
	Timestamp       time.Time                `json:"timestamp" yaml:"timestamp"`
}

SecurityAnalysis represents security analysis results

type SecurityOptions

type SecurityOptions struct {
	Target string `json:"target" yaml:"target"`
	Deep   bool   `json:"deep" yaml:"deep"`
}

SecurityOptions represents security analysis options

type SecurityRecommendation

type SecurityRecommendation struct {
	Title       string   `json:"title" yaml:"title"`
	Description string   `json:"description" yaml:"description"`
	Priority    string   `json:"priority" yaml:"priority"`
	Effort      string   `json:"effort" yaml:"effort"`
	Impact      string   `json:"impact" yaml:"impact"`
	Steps       []string `json:"steps" yaml:"steps"`
	References  []string `json:"references" yaml:"references"`
}

SecurityRecommendation represents a security recommendation

type SecurityVulnerability

type SecurityVulnerability struct {
	ID          string    `json:"id" yaml:"id"`
	Title       string    `json:"title" yaml:"title"`
	Description string    `json:"description" yaml:"description"`
	Severity    string    `json:"severity" yaml:"severity"`
	CVSS        float64   `json:"cvss" yaml:"cvss"`
	Component   string    `json:"component" yaml:"component"`
	Status      string    `json:"status" yaml:"status"`
	FirstFound  time.Time `json:"first_found" yaml:"first_found"`
	Solution    string    `json:"solution" yaml:"solution"`
}

SecurityVulnerability represents a security vulnerability

Jump to

Keyboard shortcuts

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