Documentation
¶
Index ¶
- Constants
- func ErrorfL(l *zerolog.Logger, format string, err error, args ...any) error
- func ExtractAndRunNativeBin() error
- func GetBuiltAppVersion() string
- func GetDefaultHostname() string
- func GetDeviceID() string
- func GetLocalVersion() (systemVersion *semver.Version, appVersion *semver.Version, err error)
- func GetNativeVersion() (string, error)
- func GetVersionData(isJson bool) ([]byte, error)
- func HandleVideoStateMessage(event CtrlResponse)
- func IsUpdatePending() bool
- func LoadConfig()
- func Main()
- func RunWebSecureServer()
- func RunWebServer()
- func RunWebsocketClient()
- func SaveConfig() error
- func StartNativeCtrlSocketServer()
- func StartNativeSocketServer(socketPath string, handleClient func(net.Conn), isCtrl bool) net.Listener
- func StartNativeVideoSocketServer()
- func TryUpdate(ctx context.Context, deviceId string, includePreRelease bool) error
- func WriteCtrlMessage(message []byte) error
- type ATXState
- type BacklightSettings
- type ChangePasswordRequest
- type CloudConnectionState
- type CloudRegisterRequest
- type CloudState
- type Config
- type CtrlAction
- type CtrlResponse
- type DCPowerState
- type DevModeState
- type DeviceStatus
- type DisplayRotationSettings
- type EventHandler
- type JSONRPCEvent
- type JSONRPCRequest
- type JSONRPCResponse
- type JigglerConfig
- type KeyboardMacro
- type KeyboardMacroStep
- type KeyboardMacrosParams
- type LocalDevice
- type LocalMetadata
- type LoginRequest
- type NBDDevice
- type OTAState
- type RPCHandler
- type SSHKeyState
- type SerialSettings
- type Session
- type SessionConfig
- type SetPasswordRequest
- type SetWakeOnLanDevicesParams
- type SetupRequest
- type StorageFile
- type StorageFileUpload
- type StorageFiles
- type StorageSpace
- type TLSState
- type TerminalSize
- type UpdateMetadata
- type UpdateStatus
- type UploadProgress
- type VideoInputState
- type VirtualMediaMode
- type VirtualMediaSource
- type VirtualMediaState
- type VirtualMediaUrlInfo
- type WakeOnLanDevice
- type WebRTCSessionRequest
Constants ¶
View Source
const ( // CloudWebSocketConnectTimeout is the timeout for the websocket connection to the cloud CloudWebSocketConnectTimeout = 1 * time.Minute // CloudAPIRequestTimeout is the timeout for cloud API requests CloudAPIRequestTimeout = 10 * time.Second // CloudOidcRequestTimeout is the timeout for OIDC token verification requests // should be lower than the websocket response timeout set in cloud-api CloudOidcRequestTimeout = 10 * time.Second // WebsocketPingInterval is the interval at which the websocket client sends ping messages to the cloud WebsocketPingInterval = 15 * time.Second )
View Source
const ( MaxMacrosPerDevice = 25 MaxStepsPerMacro = 10 MaxKeysPerStep = 10 MinStepDelay = 50 MaxStepDelay = 2000 )
Constants for keyboard macro limits
View Source
const (
NetIfName = "eth0"
)
View Source
const UpdateMetadataUrl = "https://api.jetkvm.com/releases"
Variables ¶
This section is empty.
Functions ¶
func ExtractAndRunNativeBin ¶
func ExtractAndRunNativeBin() error
func GetBuiltAppVersion ¶
func GetBuiltAppVersion() string
func GetDefaultHostname ¶
func GetDefaultHostname() string
func GetDeviceID ¶
func GetDeviceID() string
func GetLocalVersion ¶
func GetLocalVersion() (systemVersion *semver.Version, appVersion *semver.Version, err error)
func GetNativeVersion ¶
func GetVersionData ¶
func HandleVideoStateMessage ¶
func HandleVideoStateMessage(event CtrlResponse)
func IsUpdatePending ¶
func IsUpdatePending() bool
func LoadConfig ¶
func LoadConfig()
func RunWebSecureServer ¶
func RunWebSecureServer()
func RunWebServer ¶
func RunWebServer()
func RunWebsocketClient ¶
func RunWebsocketClient()
func SaveConfig ¶
func SaveConfig() error
func StartNativeCtrlSocketServer ¶
func StartNativeCtrlSocketServer()
func StartNativeSocketServer ¶
func StartNativeVideoSocketServer ¶
func StartNativeVideoSocketServer()
func WriteCtrlMessage ¶
Types ¶
type BacklightSettings ¶
type ChangePasswordRequest ¶
type CloudConnectionState ¶
type CloudConnectionState uint8
const ( CloudConnectionStateNotConfigured CloudConnectionState = iota CloudConnectionStateDisconnected CloudConnectionStateConnecting CloudConnectionStateConnected )
type CloudRegisterRequest ¶
type CloudState ¶
type Config ¶
type Config struct { CloudURL string `json:"cloud_url"` CloudAppURL string `json:"cloud_app_url"` CloudToken string `json:"cloud_token"` GoogleIdentity string `json:"google_identity"` JigglerEnabled bool `json:"jiggler_enabled"` JigglerConfig *JigglerConfig `json:"jiggler_config"` AutoUpdateEnabled bool `json:"auto_update_enabled"` IncludePreRelease bool `json:"include_pre_release"` HashedPassword string `json:"hashed_password"` LocalAuthToken string `json:"local_auth_token"` LocalAuthMode string `json:"localAuthMode"` //TODO: fix it with migration LocalLoopbackOnly bool `json:"local_loopback_only"` WakeOnLanDevices []WakeOnLanDevice `json:"wake_on_lan_devices"` KeyboardMacros []KeyboardMacro `json:"keyboard_macros"` KeyboardLayout string `json:"keyboard_layout"` EdidString string `json:"hdmi_edid_string"` ActiveExtension string `json:"active_extension"` DisplayRotation string `json:"display_rotation"` DisplayMaxBrightness int `json:"display_max_brightness"` DisplayDimAfterSec int `json:"display_dim_after_sec"` DisplayOffAfterSec int `json:"display_off_after_sec"` TLSMode string `json:"tls_mode"` // options: "self-signed", "user-defined", "" UsbConfig *usbgadget.Config `json:"usb_config"` UsbDevices *usbgadget.Devices `json:"usb_devices"` NetworkConfig *network.NetworkConfig `json:"network_config"` DefaultLogLevel string `json:"default_log_level"` }
type CtrlAction ¶
type CtrlResponse ¶
type CtrlResponse struct { Seq int32 `json:"seq,omitempty"` Error string `json:"error,omitempty"` Errno int32 `json:"errno,omitempty"` Result map[string]any `json:"result,omitempty"` Event string `json:"event,omitempty"` Data json.RawMessage `json:"data,omitempty"` }
func CallCtrlAction ¶
func CallCtrlAction(action string, params map[string]any) (*CtrlResponse, error)
type DCPowerState ¶
type DevModeState ¶
type DevModeState struct {
Enabled bool `json:"enabled"`
}
type DeviceStatus ¶
type DeviceStatus struct {
IsSetup bool `json:"isSetup"`
}
type DisplayRotationSettings ¶
type DisplayRotationSettings struct {
Rotation string `json:"rotation"`
}
type EventHandler ¶
type EventHandler func(event CtrlResponse)
type JSONRPCEvent ¶
type JSONRPCRequest ¶
type JSONRPCResponse ¶
type JigglerConfig ¶
type KeyboardMacro ¶
type KeyboardMacro struct { ID string `json:"id"` Name string `json:"name"` Steps []KeyboardMacroStep `json:"steps"` SortOrder int `json:"sortOrder,omitempty"` }
func (*KeyboardMacro) Validate ¶
func (m *KeyboardMacro) Validate() error
type KeyboardMacroStep ¶
type KeyboardMacroStep struct { Keys []string `json:"keys"` Modifiers []string `json:"modifiers"` Delay int `json:"delay"` }
func (*KeyboardMacroStep) Validate ¶
func (s *KeyboardMacroStep) Validate() error
type KeyboardMacrosParams ¶
type KeyboardMacrosParams struct {
Macros []any `json:"macros"`
}
type LocalDevice ¶
type LocalMetadata ¶
type LoginRequest ¶
type LoginRequest struct {
Password string `json:"password"`
}
type NBDDevice ¶
type NBDDevice struct {
// contains filtered or unexported fields
}
func NewNBDDevice ¶
func NewNBDDevice() *NBDDevice
type OTAState ¶
type OTAState struct { Updating bool `json:"updating"` Error string `json:"error,omitempty"` MetadataFetchedAt *time.Time `json:"metadataFetchedAt,omitempty"` AppUpdatePending bool `json:"appUpdatePending"` SystemUpdatePending bool `json:"systemUpdatePending"` AppDownloadProgress float32 `json:"appDownloadProgress,omitempty"` //TODO: implement for progress bar AppDownloadFinishedAt *time.Time `json:"appDownloadFinishedAt,omitempty"` SystemDownloadProgress float32 `json:"systemDownloadProgress,omitempty"` //TODO: implement for progress bar SystemDownloadFinishedAt *time.Time `json:"systemDownloadFinishedAt,omitempty"` AppVerificationProgress float32 `json:"appVerificationProgress,omitempty"` AppVerifiedAt *time.Time `json:"appVerifiedAt,omitempty"` SystemVerificationProgress float32 `json:"systemVerificationProgress,omitempty"` SystemVerifiedAt *time.Time `json:"systemVerifiedAt,omitempty"` AppUpdateProgress float32 `json:"appUpdateProgress,omitempty"` //TODO: implement for progress bar AppUpdatedAt *time.Time `json:"appUpdatedAt,omitempty"` SystemUpdateProgress float32 `json:"systemUpdateProgress,omitempty"` //TODO: port rk_ota, then implement SystemUpdatedAt *time.Time `json:"systemUpdatedAt,omitempty"` }
type RPCHandler ¶
type SSHKeyState ¶
type SSHKeyState struct {
SSHKey string `json:"sshKey"`
}
type SerialSettings ¶
type Session ¶
type Session struct { VideoTrack *webrtc.TrackLocalStaticSample ControlChannel *webrtc.DataChannel RPCChannel *webrtc.DataChannel HidChannel *webrtc.DataChannel // contains filtered or unexported fields }
type SessionConfig ¶
type SetPasswordRequest ¶
type SetPasswordRequest struct {
Password string `json:"password"`
}
type SetWakeOnLanDevicesParams ¶
type SetWakeOnLanDevicesParams struct {
Devices []WakeOnLanDevice `json:"devices"`
}
type SetupRequest ¶
type StorageFile ¶
type StorageFileUpload ¶
type StorageFiles ¶
type StorageFiles struct {
Files []StorageFile `json:"files"`
}
type StorageSpace ¶
type TerminalSize ¶
type UpdateMetadata ¶
type UpdateStatus ¶
type UpdateStatus struct { Local *LocalMetadata `json:"local"` Remote *UpdateMetadata `json:"remote"` SystemUpdateAvailable bool `json:"systemUpdateAvailable"` AppUpdateAvailable bool `json:"appUpdateAvailable"` // for backwards compatibility Error string `json:"error,omitempty"` }
UpdateStatus represents the current update status
func GetUpdateStatus ¶
type UploadProgress ¶
type VideoInputState ¶
type VirtualMediaMode ¶
type VirtualMediaMode string
const ( CDROM VirtualMediaMode = "CDROM" Disk VirtualMediaMode = "Disk" )
type VirtualMediaSource ¶
type VirtualMediaSource string
const ( HTTP VirtualMediaSource = "HTTP" Storage VirtualMediaSource = "Storage" )
type VirtualMediaState ¶
type VirtualMediaState struct { Source VirtualMediaSource `json:"source"` Mode VirtualMediaMode `json:"mode"` Filename string `json:"filename,omitempty"` URL string `json:"url,omitempty"` Size int64 `json:"size"` }
type VirtualMediaUrlInfo ¶
type WakeOnLanDevice ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
tzdata
Code generated by "go run gen.go".
|
Code generated by "go run gen.go". |
usbgadget
Package usbgadget provides a high-level interface to manage USB gadgets THIS PACKAGE IS FOR INTERNAL USE ONLY AND ITS API MAY CHANGE WITHOUT NOTICE
|
Package usbgadget provides a high-level interface to manage USB gadgets THIS PACKAGE IS FOR INTERNAL USE ONLY AND ITS API MAY CHANGE WITHOUT NOTICE |
Click to show internal directories.
Click to hide internal directories.