Documentation
¶
Index ¶
- Constants
- func AllowedNodeTypeNames() []string
- type CapabilityConfig
- type Config
- type DeviceCANConfig
- type DeviceGPIOConfig
- type DeviceI2CConfig
- type DeviceSPIConfig
- type DeviceSerialConfig
- type DeviceSourceConfig
- type DeviceSourceFormatConfig
- type DeviceVendorConfig
- type LoggingConfig
- type MediaConfig
- type MetricsConfig
- type NodeDeviceConfig
- type NodeLocationConfig
- type NodeLocationCoordinates
- type NodeRoleConfig
- type RoleDataPlaneConfig
- type S3MediaConfig
- type TLSConfig
- type UpstreamConfig
Constants ¶
View Source
const ( RolePlatformNode = "platform_node" RoleDependentNode = "dependent_node" RoleSensorEffectorEdgeNode = "sensor_effector_edge_node" DataPlaneTCPClient = "tcp_client" DataPlaneQUICClient = "quic_client" )
Variables ¶
This section is empty.
Functions ¶
func AllowedNodeTypeNames ¶
func AllowedNodeTypeNames() []string
Types ¶
type CapabilityConfig ¶
type Config ¶
type Config struct {
SapientRole string `yaml:"sapient_role"`
PlatformNode NodeRoleConfig `yaml:"platform_node"`
DependentNode NodeRoleConfig `yaml:"dependent_node"`
SensorEffectorEdgeNode NodeRoleConfig `yaml:"sensor_effector_edge_node"`
Logging LoggingConfig `yaml:"logging"`
Metrics MetricsConfig `yaml:"metrics"`
}
func (Config) ActiveRole ¶
func (c Config) ActiveRole() *NodeRoleConfig
func (Config) ActiveRoleInstances ¶
func (c Config) ActiveRoleInstances() []NodeRoleConfig
func (*Config) ApplySocketDir ¶
ApplySocketDir relocates every local_socket device path in the configuration into dir, preserving each socket's base filename. This gives concurrent instances of the same scenario their own isolated socket arrays: pass the same -socket-dir to sapient-node and sapient-scenario-runner so both sides agree on the relocated paths. An empty dir leaves configured paths unchanged (backward compatible). Call after Load so source/location types are already normalized.
type DeviceCANConfig ¶
type DeviceGPIOConfig ¶
type DeviceI2CConfig ¶
type DeviceSPIConfig ¶
type DeviceSerialConfig ¶
type DeviceSourceConfig ¶
type DeviceSourceConfig struct {
Name string `yaml:"name"`
NodeType string `yaml:"node_type"`
Type string `yaml:"type"`
Device string `yaml:"device"`
Interface string `yaml:"interface"`
URL string `yaml:"url"`
Pipeline string `yaml:"pipeline"`
Network string `yaml:"network"`
MaxMessageBytes int `yaml:"max_message_bytes"`
ProbeOnStart bool `yaml:"probe_on_start"`
Required bool `yaml:"required"`
ProbeTimeoutMS int `yaml:"probe_timeout_ms"`
Format DeviceSourceFormatConfig `yaml:"format"`
Serial DeviceSerialConfig `yaml:"serial"`
GPIO DeviceGPIOConfig `yaml:"gpio"`
I2C DeviceI2CConfig `yaml:"i2c"`
SPI DeviceSPIConfig `yaml:"spi"`
CAN DeviceCANConfig `yaml:"can"`
Vendor DeviceVendorConfig `yaml:"vendor"`
Options map[string]string `yaml:"options"`
}
type DeviceVendorConfig ¶
type LoggingConfig ¶
type MediaConfig ¶
type MediaConfig struct {
Enabled bool `yaml:"enabled"`
StorageBackend string `yaml:"storage_backend"`
FileRoot string `yaml:"file_root"`
FileBaseURL string `yaml:"file_base_url"`
SnapshotPath string `yaml:"snapshot_path"`
SnapshotURL string `yaml:"snapshot_url"`
SnapshotMIMEType string `yaml:"snapshot_mime_type"`
SnapshotQueueSize int `yaml:"snapshot_upload_queue_size"`
VideoPath string `yaml:"video_path"`
VideoURL string `yaml:"video_url"`
VideoMIMEType string `yaml:"video_mime_type"`
VideoTransport string `yaml:"video_transport"`
VideoGuidance sapientmedia.VideoGuidance `yaml:"video_guidance"`
S3 S3MediaConfig `yaml:"s3"`
}
type MetricsConfig ¶
type NodeDeviceConfig ¶
type NodeDeviceConfig struct {
NodeID string `yaml:"node_id"`
Name string `yaml:"name"`
ShortName string `yaml:"short_name"`
StatusMode string `yaml:"status_mode"`
NodeTypes []string `yaml:"node_types"`
Capabilities []CapabilityConfig `yaml:"capabilities"`
StaticRegistrationFile string `yaml:"static_registration_file"`
Source DeviceSourceConfig `yaml:"source"`
Sources []DeviceSourceConfig `yaml:"sources"`
Location NodeLocationConfig `yaml:"location"`
Media MediaConfig `yaml:"media"`
}
type NodeLocationConfig ¶
type NodeLocationConfig struct {
Type string `yaml:"type"`
Device string `yaml:"device"`
Network string `yaml:"network"`
Format string `yaml:"format"`
MaxMessageBytes int `yaml:"max_message_bytes"`
Coordinates *NodeLocationCoordinates `yaml:"coordinates"`
Options map[string]string `yaml:"options"`
}
type NodeLocationCoordinates ¶
type NodeRoleConfig ¶
type NodeRoleConfig struct {
Upstream UpstreamConfig `yaml:"upstream"`
NodeID string `yaml:"node_id"`
Name string `yaml:"name"`
ShortName string `yaml:"short_name"`
StatusMode string `yaml:"status_mode"`
NodeTypes []string `yaml:"node_types"`
Capabilities []CapabilityConfig `yaml:"capabilities"`
DependentNodeIDs []string `yaml:"dependent_node_ids"`
Devices []NodeDeviceConfig `yaml:"devices"`
StaticRegistrationFile string `yaml:"static_registration_file"`
Source DeviceSourceConfig `yaml:"source"`
Sources []DeviceSourceConfig `yaml:"sources"`
Location NodeLocationConfig `yaml:"location"`
Media MediaConfig `yaml:"media"`
StatusIntervalMS int `yaml:"status_interval_ms"`
ReconnectIntervalMS int `yaml:"reconnect_interval_ms"`
RegistrationAckTimeoutMS int `yaml:"registration_ack_timeout_ms"`
WriteTimeoutMS int `yaml:"write_timeout_ms"`
DataPlane RoleDataPlaneConfig `yaml:"data_plane"`
}
func (NodeRoleConfig) ReconnectInterval ¶
func (c NodeRoleConfig) ReconnectInterval() time.Duration
func (NodeRoleConfig) RegistrationAckTimeout ¶
func (c NodeRoleConfig) RegistrationAckTimeout() time.Duration
func (NodeRoleConfig) StatusInterval ¶
func (c NodeRoleConfig) StatusInterval() time.Duration
func (NodeRoleConfig) WriteTimeout ¶
func (c NodeRoleConfig) WriteTimeout() time.Duration
type RoleDataPlaneConfig ¶
type RoleDataPlaneConfig struct {
Mode string `yaml:"mode"`
}
type S3MediaConfig ¶
type S3MediaConfig struct {
Endpoint string `yaml:"endpoint"`
Region string `yaml:"region"`
Bucket string `yaml:"bucket"`
Prefix string `yaml:"prefix"`
AccessKeyIDEnv string `yaml:"access_key_id_env"`
SecretAccessKeyEnv string `yaml:"secret_access_key_env"`
ForcePathStyle bool `yaml:"force_path_style"`
}
type UpstreamConfig ¶
Click to show internal directories.
Click to hide internal directories.