Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acknowledgement ¶
type Acknowledgement struct { BytesWritten int // Count of written bytes Latency time.Duration // Latency measured at this datapoint }
Acknowledgement is an individual datapoint
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter provides a latency measurement service
func NewAdapter ¶
func NewAdapter( signaler string, key string, ice []string, config *AdapterConfig, ctx context.Context, ) *Adapter
NewAdapter creates the adapter
func (*Adapter) Acknowledgements ¶
func (a *Adapter) Acknowledgements() chan Acknowledgement
Acknowledgements returns a channel on which all individual datapoints will be sent
func (*Adapter) Close ¶
Close disconnects the adapter from the signaler and stops all measurements, resulting in the totals being yielded
func (*Adapter) GatherTotals ¶
func (a *Adapter) GatherTotals()
GatherTotals yields the total statistics
type AdapterConfig ¶
type AdapterConfig struct { *wrtcconn.AdapterConfig OnSignalerConnect func(string) // Handler to be called when the adapter has connected to the signaler OnPeerConnect func(string) // Handler to be called when the adapter has connected to a peer OnPeerDisconnected func(string) // Handler to be called when the adapter has received a message Server bool // Whether to act as the server PacketLength int // Length of the packet to measure latency with Pause time.Duration // Amount of time to wait before measuring next latency datapoint }
AdapterConfig configures the adapter
Click to show internal directories.
Click to hide internal directories.