connection

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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) Acquire

func (c *Connection) Acquire() (transport.Stream, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL