Files
browser/platform/domain/control.go
T
2026-07-11 14:56:10 +08:00

82 lines
2.0 KiB
Go

package domain
import "time"
type RunCapabilityReport struct {
Capabilities []string
Fingerprint string
}
type RunControlHello struct {
RegistrationToken string
RunEndpointID string
DisplayName string
Version string
Status RunEndpointStatus
Platform string
CapabilityReport RunCapabilityReport
Capacity RunCapacity
}
type RunControlHelloResult struct {
Accepted bool
RunEndpointID string
SessionToken string
ServerTime time.Time
HeartbeatIntervalSeconds int
FeatureFlags []string
}
type RunControlHeartbeat struct {
RunEndpointID string
SessionToken string
Version string
Status RunEndpointStatus
CapabilityFingerprint string
Capacity RunCapacity
}
type RunControlHeartbeatResult struct {
Accepted bool
RunEndpointID string
NextHeartbeatSeconds int
RefreshCapabilities bool
ServerTime time.Time
}
type RunControlSession struct {
RunEndpointID string
SessionToken string
CapabilityFingerprint string
HeartbeatIntervalSeconds int
CreatedAt time.Time
UpdatedAt time.Time
}
func CopyRunCapabilityReport(report RunCapabilityReport) RunCapabilityReport {
report.Capabilities = CopyStringSlice(report.Capabilities)
return report
}
func CopyRunControlHello(hello RunControlHello) RunControlHello {
hello.CapabilityReport = CopyRunCapabilityReport(hello.CapabilityReport)
return hello
}
func CopyRunControlHelloResult(result RunControlHelloResult) RunControlHelloResult {
result.FeatureFlags = CopyStringSlice(result.FeatureFlags)
return result
}
func CopyRunControlHeartbeat(heartbeat RunControlHeartbeat) RunControlHeartbeat {
return heartbeat
}
func CopyRunControlHeartbeatResult(result RunControlHeartbeatResult) RunControlHeartbeatResult {
return result
}
func CopyRunControlSession(session RunControlSession) RunControlSession {
return session
}