Documentation
¶
Index ¶
- func CompileTs(tsCfg config.TsConfig, outDir string) error
- func EncodeMessage(msg ControlMessage) []byte
- func GetSocketPath() (sockFile string, sockPath string)
- func IsHostOnline() bool
- func ResolveTsEntry(entry string, tsCfg config.TsConfig) (outDir string, outFile string)
- func SendCommand(cmd string, appName string)
- func SpawnApp(app config.App, tsCfg config.TsConfig) (int, error)
- type ControlMessage
- type Guest
- type Host
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeMessage ¶
func EncodeMessage(msg ControlMessage) []byte
func GetSocketPath ¶
func IsHostOnline ¶
func IsHostOnline() bool
func ResolveTsEntry ¶
func SendCommand ¶
Types ¶
type ControlMessage ¶
type ControlMessage struct {
Cmd string `json:"cmd"`
App string `json:"app"`
MsgId string `json:"msgId"`
Text string `json:"text"`
Guests []clientRecord `json:"guests"`
Error string `json:"error"`
// `Pid` shall be provided when `Cmd` is `handshake`.
Pid int `json:"pid"`
// `conn.Close()` will destroy the connection before the final message is flushed, causing the
// other peer losing the connection and the message, and no EOF will be received. To guarantee
// the final message is sent, we need a signal (`FIN`) to indicate whether this is the final
// message, and close the connection on the receiver side.
Fin bool `json:"fin"`
}
func DecodeMessage ¶
func DecodeMessage(packet *[]byte, bufRead []byte, eof bool) []ControlMessage
Click to show internal directories.
Click to hide internal directories.