Documentation
¶
Index ¶
- type Credential
- type ScoringEngine
- func (se *ScoringEngine) EnsureCredentialsSeeded() error
- func (se *ScoringEngine) GetActiveTasks() (map[string]any, error)
- func (se *ScoringEngine) GetCredlists() (any, error)
- func (se *ScoringEngine) GetPCRHistory(teamID uint, credlistName string, username string) ([]db.PCRHistorySchema, error)
- func (se *ScoringEngine) GetTeamCredentials(teamID uint, credlistName string) ([]db.CredentialSchema, error)
- func (se *ScoringEngine) GetUptimePerService() map[uint]map[string]db.Uptime
- func (se *ScoringEngine) PauseEngine()
- func (se *ScoringEngine) RLockUptime()
- func (se *ScoringEngine) RUnlockUptime()
- func (se *ScoringEngine) ResetCredentials(teamID uint, credlistName string, changedBy 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, []string, error)
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
Credential represents a username/password pair for task execution
type ScoringEngine ¶
type ScoringEngine struct {
Config *config.ConfigSettings
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
DB *db.DB
// 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 NewTestEngine ¶
func NewTestEngine(t *testing.T, redis *testutil.RedisContainer, pg *testutil.PostgresContainer, slaThreshold int) *ScoringEngine
newTestEngine creates a minimal engine for testing
func (*ScoringEngine) EnsureCredentialsSeeded ¶
func (se *ScoringEngine) EnsureCredentialsSeeded() error
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) GetPCRHistory ¶
func (se *ScoringEngine) GetPCRHistory(teamID uint, credlistName string, username string) ([]db.PCRHistorySchema, error)
GetPCRHistory returns PCR history for admin viewing
func (*ScoringEngine) GetTeamCredentials ¶
func (se *ScoringEngine) GetTeamCredentials(teamID uint, credlistName string) ([]db.CredentialSchema, error)
GetTeamCredentials returns credentials for admin viewing
func (*ScoringEngine) GetUptimePerService ¶
func (se *ScoringEngine) GetUptimePerService() map[uint]map[string]db.Uptime
func (*ScoringEngine) PauseEngine ¶
func (se *ScoringEngine) PauseEngine()
func (*ScoringEngine) RLockUptime ¶
func (se *ScoringEngine) RLockUptime()
func (*ScoringEngine) RUnlockUptime ¶
func (se *ScoringEngine) RUnlockUptime()
func (*ScoringEngine) ResetCredentials ¶
func (se *ScoringEngine) ResetCredentials(teamID uint, credlistName string, changedBy 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"`
Credentials []Credential `json:"credentials,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.