Documentation
¶
Index ¶
- type SetModeRequest
- type SimulationHandler
- func (h *SimulationHandler) GetConfig(w http.ResponseWriter, r *http.Request)
- func (h *SimulationHandler) GetMetrics(w http.ResponseWriter, r *http.Request)
- func (h *SimulationHandler) GetStatus(w http.ResponseWriter, r *http.Request)
- func (h *SimulationHandler) ResetMetrics(w http.ResponseWriter, r *http.Request)
- func (h *SimulationHandler) SetMode(w http.ResponseWriter, r *http.Request)
- func (h *SimulationHandler) StartSimulation(w http.ResponseWriter, r *http.Request)
- func (h *SimulationHandler) StopSimulation(w http.ResponseWriter, r *http.Request)
- func (h *SimulationHandler) UpdateConfig(w http.ResponseWriter, r *http.Request)
- type StatusResponse
- type UpdateConfigRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetModeRequest ¶
type SetModeRequest struct {
Mode string `json:"mode"`
}
SetModeRequest represents a mode switch request.
type SimulationHandler ¶
type SimulationHandler struct {
// contains filtered or unexported fields
}
SimulationHandler handles HTTP requests for simulation control
func NewSimulationHandler ¶
func NewSimulationHandler( engine *service.SimulationEngine, cfg *config.SimulationConfig, met *metrics.SimulationMetrics, ) *SimulationHandler
NewSimulationHandler creates a new simulation handler
func (*SimulationHandler) GetConfig ¶
func (h *SimulationHandler) GetConfig(w http.ResponseWriter, r *http.Request)
GetConfig handles GET /api/v1/simulation/config Returns current simulation configuration.
func (*SimulationHandler) GetMetrics ¶
func (h *SimulationHandler) GetMetrics(w http.ResponseWriter, r *http.Request)
GetMetrics handles GET /api/v1/simulation/metrics Returns simulation metrics.
func (*SimulationHandler) GetStatus ¶
func (h *SimulationHandler) GetStatus(w http.ResponseWriter, r *http.Request)
GetStatus returns the current simulation status
func (*SimulationHandler) ResetMetrics ¶
func (h *SimulationHandler) ResetMetrics(w http.ResponseWriter, r *http.Request)
ResetMetrics handles POST /api/v1/simulation/metrics/reset Resets simulation metrics.
func (*SimulationHandler) SetMode ¶
func (h *SimulationHandler) SetMode(w http.ResponseWriter, r *http.Request)
SetMode handles POST /api/v1/simulation/mode Switches between realistic and demo modes.
func (*SimulationHandler) StartSimulation ¶
func (h *SimulationHandler) StartSimulation(w http.ResponseWriter, r *http.Request)
StartSimulation starts the simulation engine
func (*SimulationHandler) StopSimulation ¶
func (h *SimulationHandler) StopSimulation(w http.ResponseWriter, r *http.Request)
StopSimulation stops the simulation engine
func (*SimulationHandler) UpdateConfig ¶
func (h *SimulationHandler) UpdateConfig(w http.ResponseWriter, r *http.Request)
UpdateConfig handles PUT /api/v1/simulation/config Updates simulation configuration.
type StatusResponse ¶
StatusResponse represents the status response
type UpdateConfigRequest ¶
type UpdateConfigRequest struct {
Mode *string `json:"mode,omitempty"`
FailureRate *float64 `json:"failure_rate,omitempty"`
MinDelayMs *int `json:"min_delay_ms,omitempty"`
MaxDelayMs *int `json:"max_delay_ms,omitempty"`
FailuresEnabled *bool `json:"failures_enabled,omitempty"`
}
UpdateConfigRequest represents a configuration update request.