connmanager

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InboundConnectionEventType = "connmanager.inbound-conn"
	ConnectionClosedEventType  = "connmanager.conn-closed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionClosedEvent added in v0.2.0

type ConnectionClosedEvent struct {
	ConnectionId ouroboros.ConnectionId
	Error        error
}

type ConnectionManager

type ConnectionManager struct {
	// contains filtered or unexported fields
}

func NewConnectionManager

func NewConnectionManager(cfg ConnectionManagerConfig) *ConnectionManager

func (*ConnectionManager) AddConnection

func (c *ConnectionManager) AddConnection(conn *ouroboros.Connection)

func (*ConnectionManager) CreateOutboundConn added in v0.2.0

func (c *ConnectionManager) CreateOutboundConn(
	address string,
) (*ouroboros.Connection, error)

func (*ConnectionManager) GetConnectionById

func (c *ConnectionManager) GetConnectionById(
	connId ouroboros.ConnectionId,
) *ouroboros.Connection

func (*ConnectionManager) RemoveConnection

func (c *ConnectionManager) RemoveConnection(connId ouroboros.ConnectionId)

func (*ConnectionManager) Start added in v0.1.7

func (c *ConnectionManager) Start() error

type ConnectionManagerConfig

type ConnectionManagerConfig struct {
	Logger             *slog.Logger
	EventBus           *event.EventBus
	ConnClosedFunc     ConnectionManagerConnClosedFunc
	Listeners          []ListenerConfig
	OutboundConnOpts   []ouroboros.ConnectionOptionFunc
	OutboundSourcePort uint
}

type ConnectionManagerConnClosedFunc

type ConnectionManagerConnClosedFunc func(ouroboros.ConnectionId, error)

ConnectionManagerConnClosedFunc is a function that takes a connection ID and an optional error

type InboundConnectionEvent added in v0.1.7

type InboundConnectionEvent struct {
	ConnectionId ouroboros.ConnectionId
	LocalAddr    net.Addr
	RemoteAddr   net.Addr
}

type ListenerConfig added in v0.1.7

type ListenerConfig struct {
	UseNtC         bool
	Listener       net.Listener
	ListenNetwork  string
	ListenAddress  string
	ReuseAddress   bool
	ConnectionOpts []ouroboros.ConnectionOptionFunc
}

type UnixConn added in v0.4.0

type UnixConn struct {
	*net.UnixConn
	// contains filtered or unexported fields
}

UnixConn is a wrapper around net.UnixConn that provides a unique remote address

func NewUnixConn added in v0.4.0

func NewUnixConn(conn net.Conn) (*UnixConn, error)

func (UnixConn) RemoteAddr added in v0.4.0

func (u UnixConn) RemoteAddr() net.Addr

type UnixConnAddr added in v0.4.0

type UnixConnAddr struct {
	// contains filtered or unexported fields
}

func (UnixConnAddr) Network added in v0.4.0

func (UnixConnAddr) Network() string

func (UnixConnAddr) String added in v0.4.0

func (u UnixConnAddr) String() string

Jump to

Keyboard shortcuts

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