server

package
v0.0.0-...-e444fb7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a connected WebSocket client

type Message

type Message struct {
	Type      string      `json:"type"`
	Data      interface{} `json:"data,omitempty"`
	Timestamp int64       `json:"timestamp"`
}

Message represents a WebSocket message

type MulticastManager

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

MulticastManager handles multicast CoT transmission

func NewMulticastManager

func NewMulticastManager(addr, port string) *MulticastManager

NewMulticastManager creates a new multicast manager

func (*MulticastManager) Disable

func (mm *MulticastManager) Disable() error

Disable disables multicast transmission

func (*MulticastManager) Enable

func (mm *MulticastManager) Enable() error

Enable enables multicast transmission

func (*MulticastManager) GetStatus

func (mm *MulticastManager) GetStatus() MulticastStatus

GetStatus returns the current multicast status

func (*MulticastManager) SendPlatformUpdates

func (mm *MulticastManager) SendPlatformUpdates(platforms []models.Platform)

SendPlatformUpdates sends platform updates via multicast

type MulticastStatus

type MulticastStatus struct {
	Enabled        bool   `json:"enabled"`
	Address        string `json:"address,omitempty"`
	Port           string `json:"port,omitempty"`
	Connected      bool   `json:"connected"`
	MessagesSent   int64  `json:"messages_sent"`
	MessagesFailed int64  `json:"messages_failed"`
	LastSent       string `json:"last_sent,omitempty"`
	Error          string `json:"error,omitempty"`
}

MulticastStatus represents multicast transmission status

type PlatformTypeInfo

type PlatformTypeInfo struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Class       string                 `json:"class"`
	Category    string                 `json:"category"`
	Domain      string                 `json:"domain"`
	Affiliation string                 `json:"affiliation"`
	Description string                 `json:"description"`
	Performance map[string]interface{} `json:"performance"`
}

PlatformTypeInfo represents a platform type for the scenario builder

type PlatformUpdate

type PlatformUpdate struct {
	Type      string            `json:"type"`
	Platforms []models.Platform `json:"platforms"`
	Timestamp int64             `json:"timestamp"`
}

PlatformUpdate represents a platform update message

type Server

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

Server represents the web server for the traffic simulation

func NewServer

func NewServer(cfg *config.Config, simulation *sim.Engine) *Server

NewServer creates a new web server instance

func (*Server) ServeHTTP

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

ServeHTTP implements the http.Handler interface

func (*Server) Start

func (s *Server) Start(port string) error

Start starts the web server

func (*Server) Stop

func (s *Server) Stop()

Stop stops the web server

type SimulationStatus

type SimulationStatus struct {
	Running       bool    `json:"running"`
	Time          float64 `json:"time"`
	PlatformCount int     `json:"platform_count"`
	Speed         float64 `json:"speed"`
}

SimulationStatus represents simulation status

Jump to

Keyboard shortcuts

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