Documentation ¶
Overview ¶
Package coordinator handles high-level console synchronization for drivers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OBM ¶
type OBM interface { // Connect to the console, returning the managing Proc and an // error, if any. Dial() (Proc, error) }
A "primitive" OBM, from which the coordinator can build a driver.OBM.
type Proc ¶
type Proc interface { // Shutdown disconnects the console session managed by this Proc. // If the session is already disconnected, this is a no-op. Shutdown() error // Reader returns an io.Reader that reads from the console. Reader() io.Reader }
A proc is a live "process" managing a console connection.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
An server manages console synchronization for a single OBM. It implements the console related methods of driver.OBM, and may be embedded in another struct which handles the non-console functionality.
The zero value is not meaningful; use NewServer to create a value.
func (*Server) DialConsole ¶
func (s *Server) DialConsole() (io.ReadCloser, error)
Connect to the console. This see driver.OBM.DialConsole
func (*Server) DropConsole ¶
Disconnect the current console session. See driver.OBM.DropConsole.
func (*Server) RunInServer ¶
func (s *Server) RunInServer(fn func())
Run `fn` inside the server's main loop. This ensures that no (other) console related functionality is taken by the server while `fn` is running.