net

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	net.Conn
	stmt.StatementManager
}

Conn represents a connection interface.

func NewConnWith added in v1.3.0

func NewConnWith(netConn net.Conn) Conn

NewConn returns a new connection instance.

type ConnManager

type ConnManager interface {
	// AddConn adds the specified connection.
	AddConn(c Conn) error
	// UpdateConn updates the specified connection.
	UpdateConn(from Conn, to Conn) error
	// Conns returns the included connections.
	Conns() []Conn
	// LookupConnByUID returns a connection and true when the specified connection exists by the connection ID, otherwise nil and false.
	LookupConnByUID(cid uint64) (Conn, bool)
	// LookupConnByUUID returns the connection with the specified UUID.
	LookupConnByUUID(uuid uuid.UUID) (Conn, bool)
	// RemoveConn deletes the specified connection from the map.
	RemoveConn(conn Conn) error
	// RemoveConnByUID deletes the specified connection by the connection ID.
	RemoveConnByUID(cid uint64)
	// RemoveConnByUID deletes the specified connection by the connection ID.
	RemoveConnByUUID(uuid uuid.UUID)
	// Start starts the connection manager.
	Start() error
	// Close closes the connection manager.
	Close() error
	// Stop closes all connections.
	Stop() error
}

ConnManager represents a connection map.

func NewConnManager

func NewConnManager() ConnManager

NewConnManager returns a new connection manager instance.

Jump to

Keyboard shortcuts

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