Documentation
¶
Index ¶
- func FormatAchievementUnlock(achievement *gamification.UserAchievement) string
- func FormatLevelUpNotification(oldLevel, newLevel int, newTitle string) string
- type AchievementProgress
- type AdvancedAnalytics
- type AdvancedFilter
- type AdvancedStatsManager
- func (asm *AdvancedStatsManager) CalculateCommandScores(commands []*models.Command, customRules []*CustomCommandScore) ([]*CommandScore, error)
- func (asm *AdvancedStatsManager) CreateCustomCommandScore(score *CustomCommandScore) error
- func (asm *AdvancedStatsManager) DeleteCustomCommandScore(id string) error
- func (asm *AdvancedStatsManager) FilterCommands(filter *AdvancedFilter) ([]*models.Command, error)
- func (asm *AdvancedStatsManager) GetAdvancedAnalytics(filter *AdvancedFilter) (*AdvancedAnalytics, error)
- func (asm *AdvancedStatsManager) GetCustomCommandScores() ([]*CustomCommandScore, error)
- func (asm *AdvancedStatsManager) PerformBulkOperation(operation *BulkOperation) (*BulkOperationResult, error)
- func (asm *AdvancedStatsManager) UpdateCustomCommandScore(id string, score *CustomCommandScore) error
- type BasicStats
- type BasicStatsCalculator
- type BulkOperation
- type BulkOperationResult
- type CategoryData
- type CommandScore
- type CustomCommandScore
- type GamificationStats
- type PerformanceMetrics
- type StatsCalculator
- func (s *StatsCalculator) CalculateProductivityScore(stats *BasicStats) int
- func (s *StatsCalculator) FormatBasicStats(stats *BasicStats) string
- func (s *StatsCalculator) FormatGamificationStats(stats *GamificationStats) string
- func (s *StatsCalculator) GetBasicStats() (*BasicStats, error)
- func (s *StatsCalculator) GetGamificationStats() (*GamificationStats, error)
- func (s *StatsCalculator) GetMonthlyStats() (map[string]interface{}, error)
- func (s *StatsCalculator) GetTodayStats() (map[string]interface{}, error)
- func (s *StatsCalculator) GetWeeklyStats() (map[string]interface{}, error)
- type TimeRange
- type TrendAnalysis
- type TrendPoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAchievementUnlock ¶
func FormatAchievementUnlock(achievement *gamification.UserAchievement) string
FormatAchievementUnlock formats an achievement unlock notification
func FormatLevelUpNotification ¶
FormatLevelUpNotification formats a level up notification
Types ¶
type AchievementProgress ¶
type AchievementProgress struct {
Achievement *gamification.Achievement `json:"achievement"`
Progress int `json:"progress"`
Target int `json:"target"`
Percentage float64 `json:"percentage"`
}
AchievementProgress represents progress towards an achievement
type AdvancedAnalytics ¶
type AdvancedAnalytics struct {
Filter *AdvancedFilter `json:"filter"`
TotalCommands int `json:"total_commands"`
TimeRange *TimeRange `json:"time_range"`
CategoryBreakdown map[categories.Category]*CategoryData `json:"category_breakdown"`
PerformanceMetrics *PerformanceMetrics `json:"performance_metrics"`
TrendAnalysis *TrendAnalysis `json:"trend_analysis"`
Recommendations []string `json:"recommendations"`
}
AdvancedAnalytics represents comprehensive analytics results
type AdvancedFilter ¶
type AdvancedFilter struct {
Categories []categories.Category `json:"categories"`
DateFrom *time.Time `json:"date_from"`
DateTo *time.Time `json:"date_to"`
ExitCode *int `json:"exit_code"`
MinXP *int `json:"min_xp"`
MaxXP *int `json:"max_xp"`
CommandRegex string `json:"command_regex"`
Directory string `json:"directory"`
Duration *time.Duration `json:"duration"`
Limit int `json:"limit"`
SortBy string `json:"sort_by"`
SortOrder string `json:"sort_order"`
}
AdvancedFilter represents filtering options for advanced queries
type AdvancedStatsManager ¶
type AdvancedStatsManager struct {
// contains filtered or unexported fields
}
AdvancedStatsManager handles power user features
func NewAdvancedStatsManager ¶
func NewAdvancedStatsManager(db *database.DB) *AdvancedStatsManager
NewAdvancedStatsManager creates a new advanced stats manager
func (*AdvancedStatsManager) CalculateCommandScores ¶
func (asm *AdvancedStatsManager) CalculateCommandScores(commands []*models.Command, customRules []*CustomCommandScore) ([]*CommandScore, error)
CalculateCommandScores applies custom scoring to commands
func (*AdvancedStatsManager) CreateCustomCommandScore ¶
func (asm *AdvancedStatsManager) CreateCustomCommandScore(score *CustomCommandScore) error
CreateCustomCommandScore creates a new custom scoring rule
func (*AdvancedStatsManager) DeleteCustomCommandScore ¶
func (asm *AdvancedStatsManager) DeleteCustomCommandScore(id string) error
DeleteCustomCommandScore removes a scoring rule
func (*AdvancedStatsManager) FilterCommands ¶
func (asm *AdvancedStatsManager) FilterCommands(filter *AdvancedFilter) ([]*models.Command, error)
FilterCommands applies advanced filtering to commands
func (*AdvancedStatsManager) GetAdvancedAnalytics ¶
func (asm *AdvancedStatsManager) GetAdvancedAnalytics(filter *AdvancedFilter) (*AdvancedAnalytics, error)
GetAdvancedAnalytics provides sophisticated analytics
func (*AdvancedStatsManager) GetCustomCommandScores ¶
func (asm *AdvancedStatsManager) GetCustomCommandScores() ([]*CustomCommandScore, error)
GetCustomCommandScores retrieves all custom scoring rules
func (*AdvancedStatsManager) PerformBulkOperation ¶
func (asm *AdvancedStatsManager) PerformBulkOperation(operation *BulkOperation) (*BulkOperationResult, error)
PerformBulkOperation executes bulk operations on commands
func (*AdvancedStatsManager) UpdateCustomCommandScore ¶
func (asm *AdvancedStatsManager) UpdateCustomCommandScore(id string, score *CustomCommandScore) error
UpdateCustomCommandScore updates an existing scoring rule
type BasicStats ¶
type BasicStats struct {
TotalCommands int `json:"total_commands"`
TotalSessions int `json:"total_sessions"`
UniqueCommands int `json:"unique_commands"`
CommandsToday int `json:"commands_today"`
MostUsedCommand string `json:"most_used_command,omitempty"`
MostUsedCount int `json:"most_used_count"`
TopCommands []map[string]interface{} `json:"top_commands"`
FirstCommandTime *time.Time `json:"first_command_time,omitempty"`
LastCommandTime *time.Time `json:"last_command_time,omitempty"`
}
BasicStats represents basic usage statistics
type BasicStatsCalculator ¶
type BasicStatsCalculator struct {
// contains filtered or unexported fields
}
BasicStatsCalculator provides basic statistics calculations
func NewStatsCalculator ¶
func NewStatsCalculator(db *database.DB) *BasicStatsCalculator
NewStatsCalculator creates a new basic stats calculator
func (*BasicStatsCalculator) GetBasicStats ¶
func (bsc *BasicStatsCalculator) GetBasicStats() (map[string]interface{}, error)
GetBasicStats returns basic statistics
func (*BasicStatsCalculator) GetGamificationStats ¶
func (bsc *BasicStatsCalculator) GetGamificationStats() (map[string]interface{}, error)
GetGamificationStats returns gamification-related statistics
type BulkOperation ¶
type BulkOperation struct {
Type string `json:"type"`
Filters *AdvancedFilter `json:"filters"`
Parameters map[string]interface{} `json:"parameters"`
DryRun bool `json:"dry_run"`
}
BulkOperation represents operations that can be performed on multiple commands
type BulkOperationResult ¶
type BulkOperationResult struct {
Type string `json:"type"`
DryRun bool `json:"dry_run"`
Affected int `json:"affected"`
Errors []string `json:"errors"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
Details interface{} `json:"details"`
}
BulkOperationResult represents the result of a bulk operation
type CategoryData ¶
type CategoryData struct {
Count int `json:"count"`
Percentage float64 `json:"percentage"`
AverageXP float64 `json:"average_xp"`
SuccessRate float64 `json:"success_rate"`
TopCommands []string `json:"top_commands"`
TrendDirection string `json:"trend_direction"`
}
CategoryData represents detailed category information
type CommandScore ¶
type CommandScore struct {
Command *models.Command `json:"command"`
Score float64 `json:"score"`
Category categories.Category `json:"category"`
AppliedRules []string `json:"applied_rules"`
Rank int `json:"rank"`
}
CommandScore represents a scored command result
type CustomCommandScore ¶
type CustomCommandScore struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Patterns []string `json:"patterns"`
Category categories.Category `json:"category"`
Multiplier float64 `json:"multiplier"`
Conditions map[string]interface{} `json:"conditions"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
}
CustomCommandScore represents a custom scoring rule
type GamificationStats ¶
type GamificationStats struct {
BasicStats *BasicStats `json:"basic_stats"`
ProgressInfo *gamification.ProgressInfo `json:"progress_info"`
Achievements map[string]*gamification.UserAchievement `json:"achievements"`
RecentAchievements []*gamification.UserAchievement `json:"recent_achievements"`
NextAchievements []AchievementProgress `json:"next_achievements"`
}
GamificationStats represents gamification-enhanced statistics
type PerformanceMetrics ¶
type PerformanceMetrics struct {
AverageExecutionTime float64 `json:"average_execution_time"`
SuccessRate float64 `json:"success_rate"`
CommandsPerHour float64 `json:"commands_per_hour"`
PeakHours []int `json:"peak_hours"`
ProductivityScore float64 `json:"productivity_score"`
}
PerformanceMetrics represents performance analysis
type StatsCalculator ¶
type StatsCalculator struct {
// contains filtered or unexported fields
}
StatsCalculator handles statistics computation
func (*StatsCalculator) CalculateProductivityScore ¶
func (s *StatsCalculator) CalculateProductivityScore(stats *BasicStats) int
CalculateProductivityScore calculates a simple productivity score
func (*StatsCalculator) FormatBasicStats ¶
func (s *StatsCalculator) FormatBasicStats(stats *BasicStats) string
FormatBasicStats returns a formatted string representation of basic stats
func (*StatsCalculator) FormatGamificationStats ¶
func (s *StatsCalculator) FormatGamificationStats(stats *GamificationStats) string
FormatGamificationStats returns a formatted string representation of gamification stats
func (*StatsCalculator) GetBasicStats ¶
func (s *StatsCalculator) GetBasicStats() (*BasicStats, error)
GetBasicStats returns basic usage statistics
func (*StatsCalculator) GetGamificationStats ¶
func (s *StatsCalculator) GetGamificationStats() (*GamificationStats, error)
GetGamificationStats returns comprehensive gamification statistics
func (*StatsCalculator) GetMonthlyStats ¶
func (s *StatsCalculator) GetMonthlyStats() (map[string]interface{}, error)
GetMonthlyStats returns statistics for the current month
func (*StatsCalculator) GetTodayStats ¶
func (s *StatsCalculator) GetTodayStats() (map[string]interface{}, error)
GetTodayStats returns statistics for today
func (*StatsCalculator) GetWeeklyStats ¶
func (s *StatsCalculator) GetWeeklyStats() (map[string]interface{}, error)
GetWeeklyStats returns statistics for the current week
type TimeRange ¶
type TimeRange struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
Duration time.Duration `json:"duration"`
}
TimeRange represents a time range
type TrendAnalysis ¶
type TrendAnalysis struct {
DailyTrend []TrendPoint `json:"daily_trend"`
WeeklyTrend []TrendPoint `json:"weekly_trend"`
CategoryTrends map[string]string `json:"category_trends"`
GrowthRate float64 `json:"growth_rate"`
}
TrendAnalysis represents trend analysis data