Documentation ¶
Overview ¶
Package transport provides an interface that allows for generic transport layers between gggb and a process
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoTransport = errors.New("transport with that name does not exist")
ErrNoTransport indicates that a nonexistent transport was requested
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport interface { // GetStatus returns the current state of the transport GetStatus() util.TransportStatus // GetHumanStatus returns the status of the transport in a human readable form GetHumanStatus() string // Stdout returns a channel that will have lines from stdout sent over it. // multiple calls are not supported. This channel should be closed once the source exits Stdout() <-chan []byte // Stderr returns a channel that will have lines from stdout sent over it. // multiple calls are not supported. This channel should be closed once the source exits Stderr() <-chan []byte // Update updates the Transport with a TransportConfig Update(tomlconf.ConfigHolder) error // StopOrKiller is for the Ability to stop the process on the other side of the Transport, as is Runner interfaces.StopOrKiller // Run runs the underlying process on the Transport. It returns the return code of the process (or -1 if start failed) // a string representation of the exit, if applicable, and an error. error should be checked first as the string // may not be filled for some errors. // The passed channel should be closed when the game is started, to allow the controller to start monitoring stdio. // the start chan MUST be closed sometime before run returns Run(start chan struct{}) (int, string, error) // IsRunning returns whether or not the underlying process is currently running. For more information use GetStatus. IsRunning() bool // Writer and StringWriter versions of all the write methods, for use with Fprintf etc io.Writer io.StringWriter }
Transport is a way for a Game to talk to an underlying Process.
func GetTransport ¶
func GetTransport(name string, transportConfig tomlconf.ConfigHolder, logger *log.Logger) (Transport, error)
GetTransport returns a transport based on the given name.
Directories ¶
Path | Synopsis |
---|---|
Package network implements a Transport that works over a socket.
|
Package network implements a Transport that works over a socket. |
prog
Prog is the clientside component of networkTransport.
|
Prog is the clientside component of networkTransport. |
protocol
Package protocol holds structs and other constructs that are used by the network transport for cross-network RPC calls
|
Package protocol holds structs and other constructs that are used by the network transport for cross-network RPC calls |
Package process holds a Transport implementation that runs local, unsandboxed processes
|
Package process holds a Transport implementation that runs local, unsandboxed processes |
Package util contains utilities for use in all transport implementations
|
Package util contains utilities for use in all transport implementations |
Click to show internal directories.
Click to hide internal directories.