Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(db *database.DB, cmdr AgentCommander, resolver *configpush.Resolver, hub *events.Hub, allowedOrigins []string) http.Handler
NewRouter creates and configures the Chi HTTP router with all API routes. allowedOrigins is the list of origins permitted for CORS requests; only those origins will receive CORS response headers.
Types ¶
type AgentCommander ¶
type AgentCommander interface {
Send(agentID string, msg *backupv1.ServerMessage) error
SendCommand(agentID string, cmd *backupv1.Command) (*backupv1.CommandResult, error)
IsOnline(agentID string) bool
}
AgentCommander defines the interface for sending commands to connected agents.