Versions in this module Expand all Collapse all v0 v0.9.0 Feb 10, 2018 Changes in this version + const DefaultAllowDSCP + const DefaultAllowStamp + const DefaultAverageWindow + const DefaultClock + const DefaultCompTimerMaxErrorFactor + const DefaultCompTimerMinErrorFactor + const DefaultDF + const DefaultDSCP + const DefaultDuration + const DefaultExponentialAverageAlpha + const DefaultGCMode + const DefaultHybridTimerSleepFactor + const DefaultIPVersion + const DefaultInterval + const DefaultLength + const DefaultLocalAddress + const DefaultLocalPort + const DefaultLoose + const DefaultMaxDuration + const DefaultMaxLength + const DefaultMinInterval + const DefaultPacketBurst + const DefaultPort + const DefaultPortInt + const DefaultReceivedStats + const DefaultServerTimeout + const DefaultSetSrcIP + const DefaultStampAt + const DefaultTTL + const DefaultThreadLock + const InvalidDuration + const InvalidSeqno + var AveragerFactories = make([]AveragerFactory, 0) + var DefaultAllowFills = []string + var DefaultBindAddrs = []string + var DefaultCompTimerAverage = NewDefaultExponentialAverager() + var DefaultFillPattern = []byte("irtt") + var DefaultOpenTimeouts = Durations([]time.Duration{ ... }) + var DefaultServerFiller = NewDefaultPatternFiller() + var DefaultTimer = NewCompTimer(DefaultCompTimerAverage) + var DefaultWait = &WaitMaxRTT + var FillerFactories = make([]FillerFactory, 0) + var JSONFormatVersion = 1 + var ProtocolVersion = 1 + var TimerFactories = make([]TimerFactory, 0) + var Version = "0.9.0" + var WaiterFactories = make([]WaiterFactory, 0) + func AbsDuration(d time.Duration) time.Duration + func RegisterAverager(fn func(string) (Averager, error), usage string) + func RegisterFiller(fn func(string) (Filler, error), usage string) + func RegisterTimer(fn func(string, Averager) (Timer, error), usage string) + func RegisterWaiter(fn func(string) (Waiter, error), usage string) + func RunCLI(args []string) + type AllowStamp int + const DualStamps + const NoStamp + const SingleStamp + func ParseAllowStamp(s string) (AllowStamp, error) + func (a AllowStamp) Restrict(at StampAt) StampAt + func (a AllowStamp) String() string + type Averager interface + Average func() float64 + Push func(val float64) + String func() string + func NewAverager(s string) (Averager, error) + type AveragerFactory struct + FactoryFunc func(string) (Averager, error) + Usage string + type Bitrate uint64 + func (r Bitrate) MarshalJSON() ([]byte, error) + func (r Bitrate) String() string + type BusyTimer struct + func (bt *BusyTimer) Sleep(ctx context.Context, t time.Time, d time.Duration) (time.Time, error) + func (bt *BusyTimer) String() string + type Client struct + func NewClient(cfg *ClientConfig) *Client + func (c *Client) Run(ctx context.Context) (r *Result, err error) + type ClientConfig struct + DF DF + FillOne bool + Filler Filler + HMACKey []byte + Handler ClientHandler + IPVersion IPVersion + LocalAddr net.Addr + LocalAddress string + Loose bool + NoTest bool + OpenTimeouts Durations + RemoteAddr net.Addr + RemoteAddress string + Supplied *ClientConfig + TTL int + ThreadLock bool + Timer Timer + Waiter Waiter + func NewClientConfig() *ClientConfig + func (c *ClientConfig) MarshalJSON() ([]byte, error) + type ClientHandler interface + type Clock int + const BothClocks + const Monotonic + const Wall + func ClockFromInt(v int) (Clock, error) + func ParseClock(s string) (Clock, error) + func (tc Clock) MarshalJSON() ([]byte, error) + func (tc Clock) String() string + type Code int + const AddressMismatch + const AllocateResultsPanic + const BadHMAC + const BadMagic + const ClockMismatch + const CloseConn + const ConnTokenZero + const Connected + const ConnectedClosed + const Connecting + const DFError + const DFNotSupported + const Drop + const DurationNonPositive + const ExceededDuration + const ExpectedReplyFlag + const FieldsCapacityTooLarge + const FieldsLengthTooLarge + const InconsistentClocks + const IntervalNonPositive + const InvalidAllowStampString + const InvalidClockInt + const InvalidClockString + const InvalidConnToken + const InvalidDFString + const InvalidExpAvgAlpha + const InvalidFlagBitsSet + const InvalidGCModeString + const InvalidParamValue + const InvalidReceivedStatsInt + const InvalidReceivedStatsString + const InvalidServerFill + const InvalidServerRestriction + const InvalidSleepFactor + const InvalidStampAtInt + const InvalidStampAtString + const InvalidWaitDuration + const InvalidWaitFactor + const InvalidWaitString + const InvalidWinAvgWindow + const LargeRequest + const ListenerError + const ListenerStart + const ListenerStop + const MultipleAddresses + const NewConn + const NoDSCPSupport + const NoHMAC + const NoMatchingInterfaces + const NoMatchingInterfacesUp + const NoReceiveDstAddrSupport + const NoSuchAverager + const NoSuchFiller + const NoSuchTimer + const NoSuchWaiter + const NoSuitableAddressFound + const NoTest + const NonexclusiveMidpointTStamp + const OpenClose + const OpenTimeout + const OpenTimeoutTooShort + const ParamOverflow + const ProtocolVersionMismatch + const RemoveNoConn + const ServerClosed + const ServerFillTooLong + const ServerRestriction + const ServerStart + const ServerStop + const ShortInterval + const ShortParamBuffer + const ShortReply + const ShortWrite + const StampAtMismatch + const TTLError + const UnexpectedHMAC + const UnexpectedOpenFlag + const UnexpectedReplyFlag + const UnexpectedSequenceNumber + const UnspecifiedWithSpecifiedAddresses + const WaitForPackets + func (i Code) String() string + type CompTimer struct + MaxErrorFactor float64 + MinErrorFactor float64 + func NewCompTimer(a Averager) *CompTimer + func NewDefaultCompTimer() *CompTimer + func (ct *CompTimer) Sleep(ctx context.Context, t time.Time, d time.Duration) (time.Time, error) + func (ct *CompTimer) String() string + type CumulativeAverager struct + func (ca *CumulativeAverager) Average() float64 + func (ca *CumulativeAverager) Push(val float64) + func (ca *CumulativeAverager) String() string + type DF int + const DFDefault + const DFFalse + const DFTrue + func ParseDF(s string) (DF, error) + func (d DF) String() string + type DurationStats struct + Max time.Duration + Min time.Duration + N uint + Total time.Duration + func (s *DurationStats) IsZero() bool + func (s *DurationStats) MarshalJSON() ([]byte, error) + func (s *DurationStats) Mean() time.Duration + func (s *DurationStats) Median() (dur time.Duration, ok bool) + func (s *DurationStats) Stddev() time.Duration + func (s *DurationStats) Variance() float64 + type Durations []time.Duration + func ParseDurations(sdurs string) (durs Durations, err error) + func (ds Durations) String() string + type Error struct + func Errorf(code Code, format string, detail ...interface{}) *Error + func (e *Error) Error() string + type Event struct + Code Code + Detail []interface{} + LocalAddr *net.UDPAddr + RemoteAddr *net.UDPAddr + func Eventf(code Code, laddr *net.UDPAddr, raddr *net.UDPAddr, format string, ...) *Event + func (e *Event) String() string + type ExponentialAverager struct + Alpha float64 + func NewDefaultExponentialAverager() *ExponentialAverager + func NewExponentialAverager(alpha float64) *ExponentialAverager + func (ea *ExponentialAverager) Average() float64 + func (ea *ExponentialAverager) Push(val float64) + func (ea *ExponentialAverager) String() string + type Filler interface + String func() string + func NewFiller(s string) (Filler, error) + type FillerFactory struct + FactoryFunc func(string) (Filler, error) + Usage string + type GCMode int + const GCIdle + const GCOff + const GCOn + func ParseGCMode(s string) (GCMode, error) + func (gm GCMode) String() string + type Handler interface + OnEvent func(e *Event) + type HybridTimer struct + func NewDefaultHybridTimer() *HybridTimer + func NewHybridTimer(a Averager, sleepFactor float64) *HybridTimer + func (ht *HybridTimer) Sleep(ctx context.Context, t time.Time, d time.Duration) (time.Time, error) + func (ht *HybridTimer) SleepFactor() float64 + func (ht *HybridTimer) String() string + type IPVersion int + const DualStack + const IPv4 + const IPv6 + func IPVersionFromBooleans(ipv4 bool, ipv6 bool, dfl IPVersion) IPVersion + func IPVersionFromIP(ip net.IP) IPVersion + func IPVersionFromUDPAddr(addr *net.UDPAddr) IPVersion + func (v IPVersion) MarshalJSON() ([]byte, error) + func (v IPVersion) Separate() []IPVersion + func (v IPVersion) String() string + func (v IPVersion) ZeroIP() net.IP + type Lost int + const LostDown + const LostFalse + const LostTrue + const LostUp + func (l Lost) MarshalJSON() ([]byte, error) + func (l Lost) String() string + type Params struct + Clock Clock + DSCP int + Duration time.Duration + Interval time.Duration + Length int + ProtocolVersion int + ReceivedStats ReceivedStats + ServerFill string + StampAt StampAt + type PatternFiller struct + Bytes []byte + func NewDefaultPatternFiller() *PatternFiller + func NewPatternFiller(bytes []byte) *PatternFiller + func (f *PatternFiller) Read(p []byte) (n int, err error) + func (f *PatternFiller) String() string + type RandFiller struct + func NewRandFiller() *RandFiller + func (rf *RandFiller) String() string + type ReceivedCount uint32 + type ReceivedStats int + const ReceivedStatsBoth + const ReceivedStatsCount + const ReceivedStatsNone + const ReceivedStatsWindow + func ParseReceivedStats(s string) (ReceivedStats, error) + func ReceivedStatsFromInt(v int) (ReceivedStats, error) + func (rs ReceivedStats) MarshalJSON() ([]byte, error) + func (rs ReceivedStats) String() string + type ReceivedWindow uint64 + type Recorder struct + BytesReceived uint64 + BytesSent uint64 + Duplicates uint + FirstReceived time.Time + FirstSend time.Time + LastReceived time.Time + LastSent time.Time + LatePackets uint + RTTStats DurationStats + ReceiveDelayStats DurationStats + RecorderHandler RecorderHandler + RoundTripData []RoundTripData + SendCallStats DurationStats + SendDelayStats DurationStats + ServerPacketsReceived ReceivedCount + Start time.Time + TimerErrorStats DurationStats + Wait time.Duration + func (r *Recorder) RLock() + func (r *Recorder) RUnlock() + type RecorderHandler interface + OnReceived func(seqno Seqno, rtd *RoundTripData, pred *RoundTripData, late bool, dup bool) + OnSent func(seqno Seqno, rtd *RoundTripData) + type Result struct + Config *ClientConfig + ReceiveErr error + RoundTrips []RoundTrip + SendErr error + SystemInfo *SystemInfo + VersionInfo *VersionInfo + type RoundTrip struct + IPDV time.Duration + Lost Lost + ReceiveIPDV time.Duration + SendIPDV time.Duration + Seqno Seqno + func (rt *RoundTrip) MarshalJSON() ([]byte, error) + type RoundTripData struct + Client Timestamp + Server Timestamp + func (ts *RoundTripData) IPDVSince(pts *RoundTripData) time.Duration + func (ts *RoundTripData) IsBothTimestamped() bool + func (ts *RoundTripData) IsMonoTimestamped() bool + func (ts *RoundTripData) IsReceiveTimestamped() bool + func (ts *RoundTripData) IsSendTimestamped() bool + func (ts *RoundTripData) IsTimestamped() bool + func (ts *RoundTripData) IsWallTimestamped() bool + func (ts *RoundTripData) RTT() (rtt time.Duration) + func (ts *RoundTripData) ReceiveDelay() time.Duration + func (ts *RoundTripData) ReceiveIPDVSince(pts *RoundTripData) (d time.Duration) + func (ts *RoundTripData) ReceiveMonoDiff() time.Duration + func (ts *RoundTripData) ReceiveWallDiff() time.Duration + func (ts *RoundTripData) ReplyReceived() bool + func (ts *RoundTripData) SendDelay() time.Duration + func (ts *RoundTripData) SendIPDVSince(pts *RoundTripData) (d time.Duration) + func (ts *RoundTripData) SendMonoDiff() time.Duration + func (ts *RoundTripData) SendWallDiff() time.Duration + func (ts *RoundTripData) ServerProcessingTime() (d time.Duration) + type Seqno uint32 + type Server struct + func NewServer(cfg *ServerConfig) *Server + func (s *Server) ListenAndServe() error + func (s *Server) Shutdown() + type ServerConfig struct + Addrs []string + AllowDSCP bool + AllowFills []string + AllowStamp AllowStamp + Filler Filler + GCMode GCMode + HMACKey []byte + Handler Handler + IPVersion IPVersion + MaxDuration time.Duration + MaxLength int + MinInterval time.Duration + PacketBurst int + SetSrcIP bool + TTL int + ThreadLock bool + Timeout time.Duration + func NewServerConfig() *ServerConfig + type SimpleTimer struct + func NewSimpleTimer() *SimpleTimer + func (st *SimpleTimer) Sleep(ctx context.Context, t time.Time, d time.Duration) (time.Time, error) + func (st *SimpleTimer) String() string + type StampAt int + const AtBoth + const AtMidpoint + const AtNone + const AtReceive + const AtSend + func ParseStampAt(s string) (StampAt, error) + func StampAtFromInt(v int) (StampAt, error) + func (sa StampAt) MarshalJSON() ([]byte, error) + func (sa StampAt) String() string + type Stats struct + DownstreamLossPercent float64 + DuplicatePercent float64 + Duration time.Duration + ExpectedPacketsSent uint + LatePacketsPercent float64 + PacketLossPercent float64 + PacketsReceived uint + PacketsSent uint + ReceiveIPDVStats DurationStats + ReceiveRate Bitrate + RoundTripIPDVStats DurationStats + SendIPDVStats DurationStats + SendRate Bitrate + ServerProcessingTimeStats DurationStats + TimerErrPercent float64 + TimerMissPercent float64 + TimerMisses uint + UpstreamLossPercent float64 + type SystemInfo struct + GoVersion string + Hostname string + NumCPU int + OS string + func NewSystemInfo() *SystemInfo + type Time struct + Mono time.Duration + Wall int64 + func (ts Time) IsMonoZero() bool + func (ts Time) IsWallZero() bool + func (ts Time) IsZero() bool + type Timer interface + Sleep func(ctx context.Context, t time.Time, d time.Duration) (time.Time, error) + String func() string + func NewTimer(s string, a Averager) (Timer, error) + type TimerFactory struct + FactoryFunc func(string, Averager) (Timer, error) + Usage string + type Timestamp struct + Receive Time + Send Time + func (t Timestamp) BestReceive() Time + func (t Timestamp) BestSend() Time + func (t Timestamp) IsBothMono() bool + func (t Timestamp) IsBothWall() bool + func (t Timestamp) IsMidpoint() bool + type VersionInfo struct + IRTT string + JSONFormat int + Protocol int + func NewVersionInfo() *VersionInfo + type WaitDuration struct + D time.Duration + func (w *WaitDuration) String() string + func (w *WaitDuration) Wait(r *Recorder) time.Duration + type WaitMaxRTT struct + D time.Duration + Factor int + func (w *WaitMaxRTT) String() string + func (w *WaitMaxRTT) Wait(r *Recorder) time.Duration + type WaitMeanRTT struct + D time.Duration + Factor int + func (w *WaitMeanRTT) String() string + func (w *WaitMeanRTT) Wait(r *Recorder) time.Duration + type Waiter interface + String func() string + Wait func(r *Recorder) time.Duration + func NewWaiter(s string) (Waiter, error) + type WaiterFactory struct + FactoryFunc func(string) (Waiter, error) + Usage string + type WindowAverager struct + Window int + func NewDefaultWindowAverager() *WindowAverager + func NewWindowAverage(window int) *WindowAverager + func (wa *WindowAverager) Average() float64 + func (wa *WindowAverager) Push(val float64) + func (wa *WindowAverager) String() string