handlers

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

func New

func New(db *database.DB) *Handlers

func (*Handlers) AgentsPage

func (h *Handlers) AgentsPage(w http.ResponseWriter, r *http.Request)

func (*Handlers) CreateAgent

func (h *Handlers) CreateAgent(w http.ResponseWriter, r *http.Request)

func (*Handlers) CreateAgentCommand

func (h *Handlers) CreateAgentCommand(w http.ResponseWriter, r *http.Request)

func (*Handlers) CreateAgentEvent

func (h *Handlers) CreateAgentEvent(w http.ResponseWriter, r *http.Request)

func (*Handlers) CreateAgentTodo

func (h *Handlers) CreateAgentTodo(w http.ResponseWriter, r *http.Request)

func (*Handlers) CreateTask

func (h *Handlers) CreateTask(w http.ResponseWriter, r *http.Request)

func (*Handlers) DeleteAgent

func (h *Handlers) DeleteAgent(w http.ResponseWriter, r *http.Request)

func (*Handlers) DeleteAgentTodo

func (h *Handlers) DeleteAgentTodo(w http.ResponseWriter, r *http.Request)

func (*Handlers) DeleteTask

func (h *Handlers) DeleteTask(w http.ResponseWriter, r *http.Request)

func (*Handlers) GetAgent

func (h *Handlers) GetAgent(w http.ResponseWriter, r *http.Request)

func (*Handlers) GetFleetStatus

func (h *Handlers) GetFleetStatus(w http.ResponseWriter, r *http.Request)

func (*Handlers) GetRecentUpdates

func (h *Handlers) GetRecentUpdates(w http.ResponseWriter, r *http.Request)

func (*Handlers) GetTask

func (h *Handlers) GetTask(w http.ResponseWriter, r *http.Request)

func (*Handlers) IndexPage

func (h *Handlers) IndexPage(w http.ResponseWriter, r *http.Request)

func (*Handlers) ListAgentCommands

func (h *Handlers) ListAgentCommands(w http.ResponseWriter, r *http.Request)

func (*Handlers) ListAgentEvents

func (h *Handlers) ListAgentEvents(w http.ResponseWriter, r *http.Request)

func (*Handlers) ListAgentTodos

func (h *Handlers) ListAgentTodos(w http.ResponseWriter, r *http.Request)

func (*Handlers) ListAgents

func (h *Handlers) ListAgents(w http.ResponseWriter, r *http.Request)

func (*Handlers) ListTasks

func (h *Handlers) ListTasks(w http.ResponseWriter, r *http.Request)

func (*Handlers) SSEHandler

func (h *Handlers) SSEHandler(w http.ResponseWriter, r *http.Request)

SSEHandler handles Server-Sent Events connections

func (*Handlers) UpdateAgent

func (h *Handlers) UpdateAgent(w http.ResponseWriter, r *http.Request)

func (*Handlers) UpdateAgentCommand

func (h *Handlers) UpdateAgentCommand(w http.ResponseWriter, r *http.Request)

func (*Handlers) UpdateAgentTodo

func (h *Handlers) UpdateAgentTodo(w http.ResponseWriter, r *http.Request)

func (*Handlers) UpdateTask

func (h *Handlers) UpdateTask(w http.ResponseWriter, r *http.Request)

type SSEClient

type SSEClient struct {
	ID      string
	Channel chan []byte
	Request *http.Request
	Writer  http.ResponseWriter
	Flusher http.Flusher
	// contains filtered or unexported fields
}

SSEClient represents a Server-Sent Events client

type SSEEvent

type SSEEvent struct {
	Event string      `json:"event"`
	Data  interface{} `json:"data"`
}

SSEEvent represents a Server-Sent Event

type SSEManager

type SSEManager struct {
	// contains filtered or unexported fields
}

SSEManager manages Server-Sent Events connections

func NewSSEManager

func NewSSEManager() *SSEManager

NewSSEManager creates a new SSE manager

func (*SSEManager) BroadcastAgentErrorPosted

func (m *SSEManager) BroadcastAgentErrorPosted(agentID, errorMsg string, agent *models.Agent)

func (*SSEManager) BroadcastAgentEventCreated

func (m *SSEManager) BroadcastAgentEventCreated(agentID string, agentEvent *models.Event)

func (*SSEManager) BroadcastAgentProgressUpdated

func (m *SSEManager) BroadcastAgentProgressUpdated(agentID string, progress, filesChanged, linesAdded, linesRemoved int)

func (*SSEManager) BroadcastAgentQuestionPosted

func (m *SSEManager) BroadcastAgentQuestionPosted(agentID, question string, agent *models.Agent)

func (*SSEManager) BroadcastAgentStatusChanged

func (m *SSEManager) BroadcastAgentStatusChanged(agentID, oldStatus, newStatus string, agent *models.Agent)

func (*SSEManager) BroadcastAgentStepUpdated

func (m *SSEManager) BroadcastAgentStepUpdated(agentID, currentStep string, recentSteps []map[string]interface{})

func (*SSEManager) BroadcastAgentWarningPosted

func (m *SSEManager) BroadcastAgentWarningPosted(agentID, warning string, agent *models.Agent)

func (*SSEManager) BroadcastCommandReceived

func (m *SSEManager) BroadcastCommandReceived(agentID string, command *models.Command)

func (*SSEManager) BroadcastTaskAssigned

func (m *SSEManager) BroadcastTaskAssigned(task *models.Task, agentID string)

func (*SSEManager) BroadcastTodoUpdated

func (m *SSEManager) BroadcastTodoUpdated(agentID string, todo *models.TodoItem, action string)

Jump to

Keyboard shortcuts

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