Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrorControlChannelInternalError = errors.New("Internal Error")
ErrorControlChannelInternalError is returned when an inconsistent state is encountered.
var ErrorControlChannelNotOpen = errors.New("Control channel is not open")
ErrorControlChannelNotOpen is returned for any API call that cannot continue because either the ControlChannel is not ready or has encountered an error.
var ErrorRequestCancelled = errors.New("Request was cancelled")
ErrorRequestCancelled is returned by an API call when the result chan is closed without returning a result.
var ErrorStub = errors.New("This function isn't implemented :(")
ErrorStub is returned by functions that aren't complete, which is basically all of them, what are you even doing here.
Functions ¶
This section is empty.
Types ¶
type ControlChannel ¶
type ControlChannel struct {
// contains filtered or unexported fields
}
func NewControlChannel ¶
func NewControlChannel(r ControlChannelReader, w ControlChannelWriter) (c *ControlChannel)
func (*ControlChannel) Close ¶
func (c *ControlChannel) Close()
Close will terminate the control channel and close any pending request chans.
func (*ControlChannel) IsOpen ¶
func (c *ControlChannel) IsOpen() bool
IsOpen returns true if c.State() == ControlChannelStateOpen.
func (*ControlChannel) LastError ¶
func (c *ControlChannel) LastError() error
LastError returns the last error that occurred on this ControlChannel. Will return nil if everything's OK.
func (*ControlChannel) NewRemoteIPDialer ¶
func (c *ControlChannel) NewRemoteIPDialer() (d *RemoteIPDialer, err error)
NewRemoteIPDialer creates a reusable interface for Dialing new connections.
func (*ControlChannel) State ¶
func (c *ControlChannel) State() ControlChannelState
State returns one of the ControlChannelState constants that describes this ControlChannel.
type ControlChannelReader ¶
type ControlChannelReader func(interface{}) error
A ControlChannelReader is a function that will fill its parameter with values after reading from some abstract pipe, returning nil or an error.
type ControlChannelState ¶
type ControlChannelState uint
ControlChannelState describes the current state of a ControlChannel.
const ( ControlChannelStateNew ControlChannelState = iota ControlChannelStateWaiting ControlChannelStateOpen ControlChannelStateClosing ControlChannelStateClosed )
type ControlChannelWriter ¶
type ControlChannelWriter func(interface{}) error
A ControlChannelWriter is a function that will write its parameter to an abstract pipe, returning nil or an error.
type RemoteIPConn ¶
type RemoteIPConn struct {
// contains filtered or unexported fields
}
A RemoteIPConn implements simple ReadWriteCloser semantics.
func (*RemoteIPConn) Close ¶
func (c *RemoteIPConn) Close() error
Close closes the socket on the remote endpoint. The RemoteIPConn will be invalid afterward.
type RemoteIPDialer ¶
type RemoteIPDialer struct {
// contains filtered or unexported fields
}
A RemoteIPDialer allows you to open an IP connection from a remote endpoint.
func (*RemoteIPDialer) Dial ¶
func (d *RemoteIPDialer) Dial(network, address string) (*RemoteIPConn, error)
Dial attemps to open a socket from the perspective of a remote endpoint.
type RequestPayload ¶
RequestPayload encodes the packet format for a request.