Documentation
¶
Index ¶
- type EntityHandler
- type HealthHandler
- type MonitorHandler
- type OrganizationHandler
- func (h *OrganizationHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h *OrganizationHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *OrganizationHandler) Get(w http.ResponseWriter, r *http.Request)
- func (h *OrganizationHandler) List(w http.ResponseWriter, r *http.Request)
- type SignalRequest
- type VideoHandler
- type WebRTCHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityHandler ¶
type EntityHandler struct {
// contains filtered or unexported fields
}
func NewEntityHandler ¶
func NewEntityHandler(service *services.EntityService) *EntityHandler
func (*EntityHandler) Create ¶
func (h *EntityHandler) Create(w http.ResponseWriter, r *http.Request)
Create godoc @Summary Create entity @Description Create a new entity within an organization @Tags Entities @Accept json @Produce json @Param org_id query string true "Organization ID" @Param entity body ontology.CreateEntityRequest true "Entity data" @Success 201 {object} ontology.Entity @Failure 400 {object} map[string]interface{} @Failure 401 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Security BearerAuth @Router /entities [post]
func (*EntityHandler) Delete ¶
func (h *EntityHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete godoc @Summary Delete entity @Description Delete an entity by ID @Tags Entities @Accept json @Produce json @Param org_id query string true "Organization ID" @Param entity_id query string true "Entity ID" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]interface{} @Failure 401 {object} map[string]interface{} @Failure 404 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Security BearerAuth @Router /entities [delete]
func (*EntityHandler) ListOrGet ¶ added in v0.0.10
func (h *EntityHandler) ListOrGet(w http.ResponseWriter, r *http.Request)
ListOrGet godoc @Summary List or get entities @Description Get a list of entities for an organization, or a single entity if entity_id is provided @Tags Entities @Accept json @Produce json @Param org_id query string true "Organization ID" @Param entity_id query string false "Entity ID (optional - if provided, returns single entity)" @Success 200 {object} ontology.Entity "Single entity (when entity_id provided)" @Success 200 {array} ontology.Entity "List of entities (when entity_id not provided)" @Failure 400 {object} map[string]interface{} @Failure 401 {object} map[string]interface{} @Failure 404 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Security BearerAuth @Router /entities [get]
func (*EntityHandler) Update ¶
func (h *EntityHandler) Update(w http.ResponseWriter, r *http.Request)
Update godoc @Summary Update entity @Description Update an existing entity @Tags Entities @Accept json @Produce json @Param org_id query string true "Organization ID" @Param entity_id query string true "Entity ID" @Param updates body object true "Fields to update" @Success 200 {object} ontology.Entity @Failure 400 {object} map[string]interface{} @Failure 401 {object} map[string]interface{} @Failure 404 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Security BearerAuth @Router /entities [put]
type HealthHandler ¶
type HealthHandler struct {
// contains filtered or unexported fields
}
func NewHealthHandler ¶
func NewHealthHandler(db *sql.DB, nats *embeddednats.EmbeddedNATS) *HealthHandler
func (*HealthHandler) Check ¶
func (h *HealthHandler) Check(w http.ResponseWriter, r *http.Request)
Check godoc @Summary Health check @Description Get the health status of the API and its dependencies @Tags Health @Accept json @Produce json @Success 200 {object} map[string]interface{} @Failure 503 {object} map[string]interface{} @Router /health [get]
type MonitorHandler ¶
type MonitorHandler struct{}
func NewMonitorHandler ¶
func NewMonitorHandler() *MonitorHandler
func (*MonitorHandler) SSE ¶
func (h *MonitorHandler) SSE(w http.ResponseWriter, r *http.Request)
type OrganizationHandler ¶
type OrganizationHandler struct {
// contains filtered or unexported fields
}
func NewOrganizationHandler ¶
func NewOrganizationHandler(service *services.OrganizationService) *OrganizationHandler
func (*OrganizationHandler) Create ¶
func (h *OrganizationHandler) Create(w http.ResponseWriter, r *http.Request)
Create godoc @Summary Create organization @Description Create a new organization @Tags Organizations @Accept json @Produce json @Param organization body ontology.CreateOrganizationRequest true "Organization data" @Success 201 {object} ontology.Organization @Failure 400 {object} map[string]interface{} @Failure 401 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Security BearerAuth @Router /organizations [post]
func (*OrganizationHandler) Delete ¶
func (h *OrganizationHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete godoc @Summary Delete organization @Description Delete an organization by ID @Tags Organizations @Accept json @Produce json @Param org_id query string true "Organization ID" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]interface{} @Failure 401 {object} map[string]interface{} @Failure 404 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Security BearerAuth @Router /organizations [delete]
func (*OrganizationHandler) Get ¶
func (h *OrganizationHandler) Get(w http.ResponseWriter, r *http.Request)
func (*OrganizationHandler) List ¶
func (h *OrganizationHandler) List(w http.ResponseWriter, r *http.Request)
List godoc @Summary List organizations @Description Get a list of all organizations @Tags Organizations @Accept json @Produce json @Success 200 {array} ontology.Organization @Failure 401 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Security BearerAuth @Router /organizations [get]
type SignalRequest ¶ added in v0.0.7
type SignalRequest struct {
Offer webrtc.SessionDescription `json:"offer"`
EntityID string `json:"entity_id"`
}
SignalRequest represents the signaling request body
type VideoHandler ¶ added in v0.0.5
type VideoHandler struct {
// contains filtered or unexported fields
}
VideoHandler handles video streaming API endpoints
func NewVideoHandler ¶ added in v0.0.5
func NewVideoHandler(natsEmbedded *embeddednats.EmbeddedNATS) *VideoHandler
NewVideoHandler creates a new video handler
func (*VideoHandler) List ¶ added in v0.0.5
func (h *VideoHandler) List(w http.ResponseWriter, r *http.Request)
List returns list of entities with active video streams via SSE GET /api/v1/video/list
func (*VideoHandler) Stream ¶ added in v0.0.5
func (h *VideoHandler) Stream(w http.ResponseWriter, r *http.Request)
Stream serves an MJPEG stream for a specific entity GET /api/v1/video/stream/{entity_id} This subscribes to constellation.video.{entity_id} and streams frames as multipart/x-mixed-replace
type WebRTCHandler ¶ added in v0.0.7
type WebRTCHandler struct {
// contains filtered or unexported fields
}
WebRTCHandler handles WebRTC signaling and media streaming
func NewWebRTCHandler ¶ added in v0.0.7
func NewWebRTCHandler(natsEmbedded *embeddednats.EmbeddedNATS) *WebRTCHandler
NewWebRTCHandler creates a new WebRTC handler
func (*WebRTCHandler) Signal ¶ added in v0.0.7
func (h *WebRTCHandler) Signal(w http.ResponseWriter, r *http.Request)
Signal handles the initial WebRTC handshake request POST /api/v1/webrtc/signal
func (*WebRTCHandler) Start ¶ added in v0.0.7
func (h *WebRTCHandler) Start() error
Start begins consuming video from NATS and feeding WebRTC tracks