Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnKey ¶
type ConnKey func(connection conn.Connection) string
the callback for getting connection key
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
connection instances management
func NewManager ¶
func NewManager(connKey ConnKey) *ConnectionManager
new connection manager instance you the conn key like this:
func getConnKey(conn conn.Connection) string { return conn.ConnectionState().Headers.Get("node_id") }
func (*ConnectionManager) AddConnection ¶
func (mgr *ConnectionManager) AddConnection(conn conn.Connection)
add connection into store
func (*ConnectionManager) DelConnection ¶
func (mgr *ConnectionManager) DelConnection(conn conn.Connection)
delete connection from store
func (*ConnectionManager) GetConnection ¶
func (mgr *ConnectionManager) GetConnection(key string) (conn.Connection, bool)
get connection for store
func (*ConnectionManager) Range ¶
func (mgr *ConnectionManager) Range(f func(key, value interface{}) bool)
Click to show internal directories.
Click to hide internal directories.