Documentation
¶
Index ¶
- Constants
- type Link
- func (l *Link) Establish() error
- func (l *Link) GetAge() float64
- func (l *Link) GetEstablishmentRate() float64
- func (l *Link) GetQ() float64
- func (l *Link) GetRSSI() float64
- func (l *Link) GetRTT() float64
- func (l *Link) GetRemoteIdentity() *identity.Identity
- func (l *Link) GetSNR() float64
- func (l *Link) GetStatus() byte
- func (l *Link) HandleIdentification(data []byte) error
- func (l *Link) HandleInbound(data []byte) error
- func (l *Link) HandleProofRequest(packet *packet.Packet) bool
- func (l *Link) Identify(id *identity.Identity) error
- func (l *Link) InactiveFor() float64
- func (l *Link) IsActive() bool
- func (l *Link) NoDataFor() float64
- func (l *Link) NoInboundFor() float64
- func (l *Link) NoOutboundFor() float64
- func (l *Link) Request(path string, data []byte, timeout time.Duration) (*RequestReceipt, error)
- func (l *Link) SendPacket(data []byte) error
- func (l *Link) SendResource(res *resource.Resource) error
- func (l *Link) SetLinkClosedCallback(callback func(*Link))
- func (l *Link) SetPacketCallback(callback func([]byte, *packet.Packet))
- func (l *Link) SetProofCallback(callback func(*packet.Packet) bool)
- func (l *Link) SetProofStrategy(strategy byte) error
- func (l *Link) SetRTT(rtt float64)
- func (l *Link) SetRemoteIdentifiedCallback(callback func(*Link, *identity.Identity))
- func (l *Link) SetResourceCallback(callback func(interface{}) bool)
- func (l *Link) SetResourceConcludedCallback(callback func(interface{}))
- func (l *Link) SetResourceStartedCallback(callback func(interface{}))
- func (l *Link) SetResourceStrategy(strategy byte) error
- func (l *Link) Start()
- func (l *Link) Teardown()
- func (l *Link) TrackPhyStats(track bool)
- func (l *Link) UpdatePhyStats(rssi, snr, q float64)
- type RequestReceipt
Constants ¶
View Source
const ( CURVE = "Curve25519" ESTABLISHMENT_TIMEOUT_PER_HOP = 6 KEEPALIVE_TIMEOUT_FACTOR = 4 STALE_GRACE = 2 KEEPALIVE = 360 STALE_TIME = 720 ACCEPT_NONE = 0x00 ACCEPT_ALL = 0x01 ACCEPT_APP = 0x02 STATUS_PENDING = 0x00 STATUS_ACTIVE = 0x01 STATUS_CLOSED = 0x02 STATUS_FAILED = 0x03 PROVE_NONE = 0x00 PROVE_ALL = 0x01 PROVE_APP = 0x02 WATCHDOG_MIN_SLEEP = 0.025 WATCHDOG_INTERVAL = 0.1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func NewLink ¶
func NewLink(dest *destination.Destination, transport *transport.Transport, networkIface common.NetworkInterface, establishedCallback func(*Link), closedCallback func(*Link)) *Link
func (*Link) GetEstablishmentRate ¶
func (*Link) GetRemoteIdentity ¶
func (*Link) HandleIdentification ¶
func (*Link) HandleInbound ¶
func (*Link) InactiveFor ¶
func (*Link) NoInboundFor ¶
func (*Link) NoOutboundFor ¶
func (*Link) SendPacket ¶
func (*Link) SetLinkClosedCallback ¶
func (*Link) SetPacketCallback ¶
func (*Link) SetProofStrategy ¶
func (*Link) SetRemoteIdentifiedCallback ¶
func (*Link) SetResourceCallback ¶
func (*Link) SetResourceConcludedCallback ¶
func (l *Link) SetResourceConcludedCallback(callback func(interface{}))
func (*Link) SetResourceStartedCallback ¶
func (l *Link) SetResourceStartedCallback(callback func(interface{}))
func (*Link) SetResourceStrategy ¶
func (*Link) TrackPhyStats ¶
func (*Link) UpdatePhyStats ¶
type RequestReceipt ¶
type RequestReceipt struct {
// contains filtered or unexported fields
}
func (*RequestReceipt) Concluded ¶
func (r *RequestReceipt) Concluded() bool
func (*RequestReceipt) GetRequestID ¶
func (r *RequestReceipt) GetRequestID() []byte
func (*RequestReceipt) GetResponse ¶
func (r *RequestReceipt) GetResponse() []byte
func (*RequestReceipt) GetResponseTime ¶
func (r *RequestReceipt) GetResponseTime() float64
func (*RequestReceipt) GetStatus ¶
func (r *RequestReceipt) GetStatus() byte
Click to show internal directories.
Click to hide internal directories.