engine

package
v0.0.0-...-75ce66a Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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

func (se *ScoringEngine) UpdateCredentials(teamID uint, credlistName string, usernames []string, passwords []string) (int, error)

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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