Documentation ¶
Index ¶
- func CreateConnection(connInfo Info) (conn net.Conn, err error)
- func Listen(conn net.Conn, tok token.Token, done chan<- message.Message, ec chan<- error)
- type Channel
- func (c *Channel) Close() error
- func (c *Channel) LocalAddr() net.Addr
- func (c *Channel) Read(b []byte) (n int, err error)
- func (c *Channel) RemoteAddr() net.Addr
- func (c *Channel) SetDeadline(t time.Time) error
- func (c *Channel) SetLocalAddr(addr ChannelAddr)
- func (c *Channel) SetReadDeadline(t time.Time) error
- func (c *Channel) SetRemoteAddr(addr ChannelAddr)
- func (c *Channel) SetWriteDeadline(t time.Time) error
- func (c *Channel) Write(b []byte) (n int, err error)
- type ChannelAddr
- type Info
- type Message
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConnection ¶
CreateConnection returns a newly created connection with connInfo or an error
Types ¶
type Channel ¶
type Channel struct { LocalChan chan Message RemoteChan chan Message // contains filtered or unexported fields }
func (*Channel) RemoteAddr ¶
func (*Channel) SetLocalAddr ¶
func (c *Channel) SetLocalAddr(addr ChannelAddr)
func (*Channel) SetRemoteAddr ¶
func (c *Channel) SetRemoteAddr(addr ChannelAddr)
type ChannelAddr ¶
type ChannelAddr struct {
ID string
}
type Info ¶
type Info struct { //Type determines the network address type Type Type TCPAddr *net.TCPAddr ChanAddr ChannelAddr }
Info contains address information about one actor of a connection of the declared type
func (Info) Equal ¶
Equal returns true if both Connection Information have the same existing type and the values corresponding to this type are identical.
func (Info) NetworkAndAddr ¶
NetworkAndAddr returns the network name and addr of the connection separated by space
type Type ¶
type Type int
Type enumerates connection types
run 'go generate' in this directory if a new networkAddrType is added [source https://github.com/campoy/jsonenums]
func (Type) MarshalJSON ¶
MarshalJSON is generated so Type satisfies json.Marshaler.
func (*Type) UnmarshalJSON ¶
UnmarshalJSON is generated so Type satisfies json.Unmarshaler.