Documentation
¶
Index ¶
- Constants
- type ConnectionManager
- func (c *ConnectionManager) AddConnection(conn *ouroboros.Connection)
- func (c *ConnectionManager) AddHost(address string, port uint, tags ...ConnectionManagerTag)
- func (c *ConnectionManager) AddHostsFromTopology(topologyConfig *topology.TopologyConfig)
- func (c *ConnectionManager) GetConnectionById(connId ouroboros.ConnectionId) *ConnectionManagerConnection
- func (c *ConnectionManager) GetConnectionsByTags(tags ...ConnectionManagerTag) []*ConnectionManagerConnection
- func (c *ConnectionManager) RemoveConnection(connId ouroboros.ConnectionId)
- func (c *ConnectionManager) Start() error
- type ConnectionManagerConfig
- type ConnectionManagerConnClosedFunc
- type ConnectionManagerConnection
- type ConnectionManagerHost
- type ConnectionManagerTag
- type InboundConnectionEvent
- type ListenerConfig
Constants ¶
View Source
const (
InboundConnectionEventType = "connmanager.inbound-conn"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) AddHost ¶
func (c *ConnectionManager) AddHost( address string, port uint, tags ...ConnectionManagerTag, )
func (*ConnectionManager) AddHostsFromTopology ¶
func (c *ConnectionManager) AddHostsFromTopology( topologyConfig *topology.TopologyConfig, )
func (*ConnectionManager) GetConnectionById ¶
func (c *ConnectionManager) GetConnectionById( connId ouroboros.ConnectionId, ) *ConnectionManagerConnection
func (*ConnectionManager) GetConnectionsByTags ¶
func (c *ConnectionManager) GetConnectionsByTags( tags ...ConnectionManagerTag, ) []*ConnectionManagerConnection
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 }
type ConnectionManagerConnClosedFunc ¶
type ConnectionManagerConnClosedFunc func(ouroboros.ConnectionId, error)
ConnectionManagerConnClosedFunc is a function that takes a connection ID and an optional error
type ConnectionManagerConnection ¶
type ConnectionManagerConnection struct { Conn *ouroboros.Connection Tags map[ConnectionManagerTag]bool }
func (*ConnectionManagerConnection) AddTags ¶
func (c *ConnectionManagerConnection) AddTags(tags ...ConnectionManagerTag)
func (*ConnectionManagerConnection) RemoveTags ¶
func (c *ConnectionManagerConnection) RemoveTags(tags ...ConnectionManagerTag)
type ConnectionManagerHost ¶
type ConnectionManagerHost struct { Address string Port uint Tags map[ConnectionManagerTag]bool }
type ConnectionManagerTag ¶
type ConnectionManagerTag uint16
ConnectionManagerTag represents the various tags that can be associated with a host or connection
const ( ConnectionManagerTagNone ConnectionManagerTag = iota ConnectionManagerTagHostLocalRoot ConnectionManagerTagHostPublicRoot ConnectionManagerTagHostBootstrapPeer ConnectionManagerTagHostP2PLedger ConnectionManagerTagHostP2PGossip ConnectionManagerTagRoleInitiator ConnectionManagerTagRoleResponder )
func (ConnectionManagerTag) String ¶
func (c ConnectionManagerTag) String() string
type InboundConnectionEvent ¶ added in v0.1.7
type ListenerConfig ¶ added in v0.1.7
Click to show internal directories.
Click to hide internal directories.