Initial project snapshot
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package worker
|
||||
|
||||
import "time"
|
||||
|
||||
type Protocol string
|
||||
|
||||
const (
|
||||
ProtocolRDP Protocol = "rdp"
|
||||
)
|
||||
|
||||
type Status string
|
||||
|
||||
const (
|
||||
StatusOnline Status = "online"
|
||||
StatusDraining Status = "draining"
|
||||
StatusOffline Status = "offline"
|
||||
)
|
||||
|
||||
type AttachRequest struct {
|
||||
ResourceID string `json:"resource_id"`
|
||||
ActorID string `json:"actor_id"`
|
||||
SessionID string `json:"session_id,omitempty"`
|
||||
RequiredCapabilities []string `json:"required_capabilities,omitempty"`
|
||||
RenderQualityProfile string `json:"render_quality_profile,omitempty"`
|
||||
}
|
||||
|
||||
type WorkerLease struct {
|
||||
LeaseID string `json:"lease_id"`
|
||||
WorkerID string `json:"worker_id"`
|
||||
Protocol Protocol `json:"protocol"`
|
||||
ResourceID string `json:"resource_id"`
|
||||
SessionID string `json:"session_id"`
|
||||
Capabilities []string `json:"capabilities"`
|
||||
ControlStream string `json:"control_stream"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
RenderQualityProfile string `json:"render_quality_profile,omitempty"`
|
||||
}
|
||||
|
||||
type WorkerRegistration struct {
|
||||
WorkerID string `json:"worker_id"`
|
||||
Protocol Protocol `json:"protocol"`
|
||||
Status Status `json:"status"`
|
||||
Capabilities []string `json:"capabilities"`
|
||||
ControlStream string `json:"control_stream"`
|
||||
LastHeartbeatAt time.Time `json:"last_heartbeat_at"`
|
||||
}
|
||||
|
||||
type WorkerHeartbeat struct {
|
||||
WorkerID string `json:"worker_id"`
|
||||
Status Status `json:"status"`
|
||||
LastHeartbeatAt time.Time `json:"last_heartbeat_at"`
|
||||
}
|
||||
|
||||
type RoutedEnvelope struct {
|
||||
SessionID string `json:"session_id"`
|
||||
AttachmentID string `json:"attachment_id"`
|
||||
Type string `json:"type"`
|
||||
Payload map[string]any `json:"payload"`
|
||||
}
|
||||
Reference in New Issue
Block a user