http

package
v0.0.0-...-af4fe1c Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.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 Config

type Config struct {
	Port string
}

type CreateEventRequest

type CreateEventRequest struct {
	TriggeredBy string  `json:"triggeredBy"`
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
	Radius      float64 `json:"radius"`
}

type DeviceRegistrationRequest

type DeviceRegistrationRequest struct {
	DeviceID     string   `json:"deviceId"`
	Model        string   `json:"model"`
	Manufacturer string   `json:"manufacturer"`
	OsVersion    string   `json:"osVersion"`
	Location     Location `json:"location"`
}

type DeviceStatusResponse

type DeviceStatusResponse struct {
	IsRegistered bool `json:"isRegistered"`
}

type EventResponse

type EventResponse struct {
	ID          string                `json:"id"`
	TriggeredBy string                `json:"triggeredBy"`
	StartTime   int64                 `json:"startTime"` // Unix timestamp
	Location    database.GeoJSONPoint `json:"location"`  // You may want to further process this if needed
	Radius      float64               `json:"radius"`
	Status      string                `json:"status"`
	Streams     []StreamResponse      `json:"streams"`
}

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Accuracy  float32 `json:"accuracy"`
	Timestamp int64   `json:"timestamp"`
}

type LocationUpdateRequest

type LocationUpdateRequest struct {
	DeviceID  string  `json:"deviceId"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Accuracy  float32 `json:"accuracy"`
	Timestamp int64   `json:"timestamp"`
}

type Server

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

func NewServer

func NewServer(config *config.HTTPConfig, rtmpServer *rtmp.Server, mq *mqttclient.MQTTClient, db *database.MongoDB) *Server

func (*Server) ServeAPK

func (s *Server) ServeAPK(w http.ResponseWriter, r *http.Request)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

type StreamResponse

type StreamResponse struct {
	ID          string                `json:"id"`
	Title       string                `json:"title"`
	PlaybackUrl string                `json:"playbackUrl"`
	RTMPUrl     string                `json:"rtmpUrl"`
	DeviceId    string                `json:"deviceId"`
	Distance    float64               `json:"distance"`
	Location    database.GeoJSONPoint `json:"location"`
	StartTime   int64                 `json:"startTime"`         // Unix timestamp
	EndTime     *int64                `json:"endTime,omitempty"` // Unix timestamp
	Status      string                `json:"status"`
}

Jump to

Keyboard shortcuts

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