forked from coder/wsep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclientmsg.go
34 lines (30 loc) · 860 Bytes
/
clientmsg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package proto
// Client message header type
const (
TypeStart = "start"
TypeResize = "resize"
TypeStdin = "stdin"
TypeCloseStdin = "close_stdin"
)
// ClientResizeHeader specifies a terminal window resize request
type ClientResizeHeader struct {
Type string `json:"type"`
Rows uint16 `json:"rows"`
Cols uint16 `json:"cols"`
}
// ClientStartHeader specifies a request to start command
type ClientStartHeader struct {
Type string `json:"type"`
Command Command `json:"command"`
}
// Command represents a runnable command.
type Command struct {
Command string `json:"command"`
Args []string `json:"args"`
Stdin bool `json:"stdin"`
TTY bool `json:"tty"`
UID uint32 `json:"uid"`
GID uint32 `json:"gid"`
Env []string `json:"env"`
WorkingDir string `json:"working_dir"`
}