Files
Spark/client/service/terminal/terminal.go
XZB-1248 6920f726d7 release: v0.2.0
add: zmodem(lrzsz) support for terminal
add: update notification (won't auto update)
optimize: protocol of terminal and desktop
optimize: experience of explorer
optimize: github workflow
remove: CryptoJS
2022-11-01 08:51:47 +08:00

29 lines
685 B
Go

package terminal
import (
"Spark/utils/cmap"
"errors"
)
var terminals = cmap.New()
var (
errDataNotFound = errors.New(`no input found in packet`)
errDataInvalid = errors.New(`can not parse data in packet`)
errUUIDNotFound = errors.New(`can not find terminal identifier`)
)
// packet explanation:
// +---------+---------+----------+-------------+------+
// | magic | op code | event id | data length | data |
// +---------+---------+----------+-------------+------+
// | 5 bytes | 1 byte | 16 bytes | 2 bytes | - |
// +---------+---------+----------+-------------+------+
// magic:
// []byte{34, 22, 19, 17, 21}
// op code:
// 00: binary packet
// 01: JSON packet