Documentation
¶
Index ¶
- type ScoringEngine
- func (se *ScoringEngine) GetActiveTasks() (map[string]any, error)
- func (se *ScoringEngine) GetCredlists() (any, error)
- func (se *ScoringEngine) GetUptimePerService() map[uint]map[string]db.Uptime
- func (se *ScoringEngine) LoadCredentials() error
- func (se *ScoringEngine) PauseEngine()
- func (se *ScoringEngine) ResetCredentials(teamID uint, credlistName string) error
- func (se *ScoringEngine) ResetScores() error
- func (se *ScoringEngine) ResumeEngine()
- func (se *ScoringEngine) Start()
- func (se *ScoringEngine) UpdateCredentials(teamID uint, credlistName string, usernames []string, passwords []string) (int, error)
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScoringEngine ¶
type ScoringEngine struct {
Config *config.ConfigSettings
CredentialsMutex map[uint]*sync.Mutex
UptimePerService map[uint]map[string]db.Uptime
SlaPerService map[uint]map[string]int
EnginePauseWg *sync.WaitGroup
IsEnginePaused bool
CurrentRound uint
NextRoundStartTime time.Time
CurrentRoundStartTime time.Time
RedisClient *redis.Client
// Concurrency control for materialized view refresh
Refreshing atomic.Bool
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(conf *config.ConfigSettings, configPath string) *ScoringEngine
func (*ScoringEngine) GetActiveTasks ¶
func (se *ScoringEngine) GetActiveTasks() (map[string]any, error)
GetActiveTasks returns all active and recently completed tasks
func (*ScoringEngine) GetCredlists ¶
func (se *ScoringEngine) GetCredlists() (any, error)
func (*ScoringEngine) GetUptimePerService ¶
func (se *ScoringEngine) GetUptimePerService() map[uint]map[string]db.Uptime
func (*ScoringEngine) LoadCredentials ¶
func (se *ScoringEngine) LoadCredentials() error
func (*ScoringEngine) PauseEngine ¶
func (se *ScoringEngine) PauseEngine()
func (*ScoringEngine) ResetCredentials ¶
func (se *ScoringEngine) ResetCredentials(teamID uint, credlistName string) error
func (*ScoringEngine) ResetScores ¶
func (se *ScoringEngine) ResetScores() error
ResetScores resets the engine to the initial state and stops the engine
func (*ScoringEngine) ResumeEngine ¶
func (se *ScoringEngine) ResumeEngine()
func (*ScoringEngine) Start ¶
func (se *ScoringEngine) Start()
func (*ScoringEngine) UpdateCredentials ¶
type Task ¶
type Task struct {
TeamID uint `json:"team_id"` // Numeric identifier for the team
TeamIdentifier string `json:"team_identifier"` // Human-readable identifier for the team
ServiceType string `json:"service_type"`
ServiceName string `json:"service_name"`
Deadline time.Time `json:"deadline"`
RoundID uint `json:"round_id"`
Attempts int `json:"attempts"`
CheckData json.RawMessage `json:"check_data"`
}
Click to show internal directories.
Click to hide internal directories.