Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { PeerIdentifier // contains filtered or unexported fields }
Peer keeps a subscriber to send status updates to it, and the PeerAgent that created it
func NewPeer ¶
func NewPeer(pid PeerIdentifier, agent transport.Agent) *Peer
NewPeer creates a new hostport.Peer from a hostport.PeerIdentifier, transport.Agent, and transport.PeerSubscriber
func (*Peer) Agent ¶
Agent returns the Agent that is in charge of this hostport.Peer (and should be the one to handle requests)
func (*Peer) HostPort ¶
HostPort surfaces the HostPort in this function, if you want to access the hostport directly (for a downstream call) You need to cast the transport.Peer to a *hostport.Peer and run this function
func (*Peer) SetStatus ¶
func (p *Peer) SetStatus(status transport.PeerConnectionStatus)
SetStatus sets the status of the Peer (to be used by the Agent)
func (*Peer) StartRequest ¶
func (p *Peer) StartRequest() func()
StartRequest runs at the beginning of a request and returns a callback for when the request finished
func (*Peer) Status ¶
func (p *Peer) Status() transport.PeerStatus
Status returns the current status of the hostport.Peer
type PeerIdentifier ¶
type PeerIdentifier string
PeerIdentifier uniquely references a host:port combination using a common interface
func (PeerIdentifier) Identifier ¶
func (p PeerIdentifier) Identifier() string
Identifier generates a (should be) unique identifier for this PeerIdentifier (to use in maps, etc)