Versions in this module Expand all Collapse all v0 v0.2.3 Feb 27, 2015 v0.2.2 Feb 27, 2015 Changes in this version + var ErrGroupNotFound = errors.New("group not found") + var ErrInvalidConnSelected = errors.New("invalid selected connection") + var ErrNoConnections = errors.New("no connections") + var GarbageCollectTimeout = 5 * time.Second + var SelectRandomConn = func(conns []*Conn) *Conn + func CloseHandler(s *Stream) + func ConnInConns(c1 *Conn, conns []*Conn) bool + func EchoHandler(s *Stream) + func NoOpConnHandler(c *Conn) + func NoOpStreamHandler(s *Stream) + type Conn struct + func ConnsWithGroup(g Group, conns []*Conn) []*Conn + func (c *Conn) AddGroup(g Group) + func (c *Conn) Close() error + func (c *Conn) Conn() pst.Conn + func (c *Conn) Groups() []Group + func (c *Conn) InGroup(g Group) bool + func (c *Conn) NetConn() net.Conn + func (c *Conn) NewStream() (*Stream, error) + func (c *Conn) Streams() []*Stream + func (c *Conn) String() string + func (c *Conn) Swarm() *Swarm + type ConnHandler func(s *Conn) + type Group interface + type Groupable interface + AddGroup func(g Group) + Groups func() []Group + InGroup func(g Group) bool + type Listener struct + func ListenersWithGroup(g Group, ls []*Listener) []*Listener + func (l *Listener) AcceptErrors() <-chan error + func (l *Listener) AddGroup(g Group) + func (l *Listener) Close() error + func (l *Listener) Groups() []Group + func (l *Listener) InGroup(g Group) bool + func (l *Listener) NetListener() net.Listener + func (l *Listener) String() string + type Notifiee interface + ClosedStream func(*Stream) + Connected func(*Conn) + Disconnected func(*Conn) + OpenedStream func(*Stream) + type SelectConn func([]*Conn) *Conn + type Stream struct + func StreamsWithGroup(g Group, streams []*Stream) []*Stream + func (s *Stream) AddGroup(g Group) + func (s *Stream) Close() error + func (s *Stream) Conn() *Conn + func (s *Stream) Groups() []Group + func (s *Stream) InGroup(g Group) bool + func (s *Stream) Read(p []byte) (n int, err error) + func (s *Stream) Stream() pst.Stream + func (s *Stream) String() string + func (s *Stream) Swarm() *Swarm + func (s *Stream) Write(p []byte) (n int, err error) + type StreamHandler func(s *Stream) + type Swarm struct + func NewSwarm(t pst.Transport) *Swarm + func (s *Swarm) AddConn(netConn net.Conn) (*Conn, error) + func (s *Swarm) AddConnToGroup(conn *Conn, g Group) + func (s *Swarm) AddListener(l net.Listener) (*Listener, error) + func (s *Swarm) Close() error + func (s *Swarm) ConnHandler() ConnHandler + func (s *Swarm) Conns() []*Conn + func (s *Swarm) ConnsWithGroup(g Group) []*Conn + func (s *Swarm) Dump() string + func (s *Swarm) Listeners() []*Listener + func (s *Swarm) NewStream() (*Stream, error) + func (s *Swarm) NewStreamSelectConn(selConn SelectConn) (*Stream, error) + func (s *Swarm) NewStreamWithConn(conn *Conn) (*Stream, error) + func (s *Swarm) NewStreamWithGroup(group Group) (*Stream, error) + func (s *Swarm) NewStreamWithNetConn(netConn net.Conn) (*Stream, error) + func (s *Swarm) Notify(n Notifiee) + func (s *Swarm) SelectConn() SelectConn + func (s *Swarm) SetConnHandler(ch ConnHandler) + func (s *Swarm) SetSelectConn(cs SelectConn) + func (s *Swarm) SetStreamHandler(sh StreamHandler) + func (s *Swarm) StopNotify(n Notifiee) + func (s *Swarm) StreamHandler() StreamHandler + func (s *Swarm) Streams() []*Stream + func (s *Swarm) StreamsWithGroup(g Group) []*Stream + func (s *Swarm) String() string