forked from MOZGIII/gatewayd
/
driver.go
26 lines (20 loc) · 872 Bytes
/
driver.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
package driver
import (
"net"
"gatewayd/driver/state"
)
// Driver represnts an object capable of starting and managing
// a desktop session for us. It is responsible for strating up
// everything that is technically required for user to connect
// to: i.e. X and VNC server in LXC environment or KVM virtual
// machine with VNC display.
type Driver interface {
Assign(session Session) error // assigns session to a driver
// Actions
Start() error // starts session (probably should run driver's goroutine)
Terminate() <-chan error // terminates session (force stops the session)
// State machine
State() state.Type // the actual state of the driver for this session
StateChanged() <-chan state.Type // channel to get the updates from the driver
RemoteVNCConnection() (net.Conn, error) // returns a connection to tunnel to client
}