Documentation
¶
Index ¶
- type Connection
- func (c *Connection) Acquire() (transport.Stream, error)
- func (c *Connection) Connected() bool
- func (c *Connection) GetConnCount(subdomain ...string) int
- func (c *Connection) GetHeartbeatStats() map[string]any
- func (c *Connection) GetLastActive() time.Time
- func (c *Connection) Release(stream transport.Stream)
- func (c *Connection) Send(msg protocol.Parsable)
- func (c *Connection) SetHeartbeatConfig(interval, timeout time.Duration)
- func (c *Connection) Start()
- type MessageHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func New ¶
func New(transp transport.Transport, messageHandler ...MessageHandlerFunc) *Connection
func (*Connection) Connected ¶
func (c *Connection) Connected() bool
Connected returns true if the client is connected.
func (*Connection) GetConnCount ¶
func (c *Connection) GetConnCount(subdomain ...string) int
GetConnCount returns the client's connections.
func (*Connection) GetHeartbeatStats ¶
func (c *Connection) GetHeartbeatStats() map[string]any
GetHeartbeatStats returns the current heartbeat statistics.
func (*Connection) GetLastActive ¶
func (c *Connection) GetLastActive() time.Time
GetLastActive returns the client's last active timestamp.
func (*Connection) Release ¶
func (c *Connection) Release(stream transport.Stream)
func (*Connection) Send ¶
func (c *Connection) Send(msg protocol.Parsable)
func (*Connection) SetHeartbeatConfig ¶
func (c *Connection) SetHeartbeatConfig(interval, timeout time.Duration)
SetHeartbeatConfig updates the heartbeat configuration.
func (*Connection) Start ¶
func (c *Connection) Start()
type MessageHandlerFunc ¶
type MessageHandlerFunc func(*Connection, *protocol.Message) error
Click to show internal directories.
Click to hide internal directories.