Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AddPeer(p *Peer)
- func (m *Manager) Close() error
- func (m *Manager) GetPeer(agentID string) (*Peer, bool)
- func (m *Manager) ListPeers() []string
- func (m *Manager) OnPeerAdded(cb PeerCallback)
- func (m *Manager) RemovePeer(agentID string) error
- func (m *Manager) Send(ctx context.Context, agentID string, env *envelope.Envelope) error
- type Peer
- type PeerCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages connections to multiple peers and selects the best transport.
func NewManager ¶
NewManager creates a new peer manager.
func (*Manager) OnPeerAdded ¶
func (m *Manager) OnPeerAdded(cb PeerCallback)
OnPeerAdded registers a callback invoked when a new peer is added.
func (*Manager) RemovePeer ¶
RemovePeer disconnects and removes a peer.
type Peer ¶
type Peer struct {
ID string
PublicKey string
Transport transport.Transport
InboxRelays []string // Nostr relay URLs for offline mailbox delivery
NostrPubKey string // Nostr secp256k1 public key (hex)
}
Peer represents a connected remote agent.
type PeerCallback ¶
type PeerCallback func(p *Peer)
PeerCallback is called when a peer event occurs.
Click to show internal directories.
Click to hide internal directories.