Documentation ¶
Index ¶
- type Connections
- type Router
- type SimpleConnections
- type SimpleRouter
- func (s SimpleRouter) AddDestination(clientId string, conn model.TagyouConn)
- func (s SimpleRouter) DestinationExists(clientId string) bool
- func (s SimpleRouter) Forward(topic string, p *packet.Packet)
- func (s SimpleRouter) RemoveDestination(clientId string)
- func (s SimpleRouter) Send(clientId string, payload []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connections ¶
type Connections interface { Add(clientId string, conn model.TagyouConn) Exists(clientId string) (model.TagyouConn, bool) Close(clientId string) error Remove(clientId string) }
type Router ¶
type SimpleConnections ¶
type SimpleConnections struct { Conns map[string]model.TagyouConn Mu sync.RWMutex }
func (*SimpleConnections) Add ¶
func (c *SimpleConnections) Add(clientId string, conn model.TagyouConn)
func (*SimpleConnections) Close ¶
func (c *SimpleConnections) Close(clientId string) error
func (*SimpleConnections) Exists ¶
func (c *SimpleConnections) Exists(clientId string) (model.TagyouConn, bool)
func (*SimpleConnections) Remove ¶
func (c *SimpleConnections) Remove(clientId string)
type SimpleRouter ¶
type SimpleRouter struct {
Conns Connections
}
func (SimpleRouter) AddDestination ¶
func (s SimpleRouter) AddDestination(clientId string, conn model.TagyouConn)
func (SimpleRouter) DestinationExists ¶
func (s SimpleRouter) DestinationExists(clientId string) bool
func (SimpleRouter) RemoveDestination ¶
func (s SimpleRouter) RemoveDestination(clientId string)
func (SimpleRouter) Send ¶
func (s SimpleRouter) Send(clientId string, payload []byte)
Click to show internal directories.
Click to hide internal directories.