Documentation ¶
Index ¶
- Constants
- func AbsDuration(d time.Duration) time.Duration
- func IsIPv4(ip net.IP) bool
- func Max(a, b int) int
- func MaxByteCount(a, b protocol.ByteCount) protocol.ByteCount
- func MaxDuration(a, b time.Duration) time.Duration
- func MaxInt64(a, b int64) int64
- func MaxPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
- func MaxTime(a, b time.Time) time.Time
- func MaxUint32(a, b uint32) uint32
- func MaxUint64(a, b uint64) uint64
- func Min(a, b int) int
- func MinByteCount(a, b protocol.ByteCount) protocol.ByteCount
- func MinDuration(a, b time.Duration) time.Duration
- func MinInt64(a, b int64) int64
- func MinNonZeroDuration(a, b time.Duration) time.Duration
- func MinNonZeroTime(a, b time.Time) time.Time
- func MinPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
- func MinTime(a, b time.Time) time.Time
- func MinUint32(a, b uint32) uint32
- func MinUint64(a, b uint64) uint64
- func NewBufferedWriteCloser(writer *bufio.Writer, closer io.Closer) io.WriteCloser
- type AtomicBool
- type ByteInterval
- type ByteIntervalElement
- type ByteIntervalList
- func (l *ByteIntervalList) Back() *ByteIntervalElement
- func (l *ByteIntervalList) Front() *ByteIntervalElement
- func (l *ByteIntervalList) Init() *ByteIntervalList
- func (l *ByteIntervalList) InsertAfter(v ByteInterval, mark *ByteIntervalElement) *ByteIntervalElement
- func (l *ByteIntervalList) InsertBefore(v ByteInterval, mark *ByteIntervalElement) *ByteIntervalElement
- func (l *ByteIntervalList) Len() int
- func (l *ByteIntervalList) MoveAfter(e, mark *ByteIntervalElement)
- func (l *ByteIntervalList) MoveBefore(e, mark *ByteIntervalElement)
- func (l *ByteIntervalList) MoveToBack(e *ByteIntervalElement)
- func (l *ByteIntervalList) MoveToFront(e *ByteIntervalElement)
- func (l *ByteIntervalList) PushBack(v ByteInterval) *ByteIntervalElement
- func (l *ByteIntervalList) PushBackList(other *ByteIntervalList)
- func (l *ByteIntervalList) PushFront(v ByteInterval) *ByteIntervalElement
- func (l *ByteIntervalList) PushFrontList(other *ByteIntervalList)
- func (l *ByteIntervalList) Remove(e *ByteIntervalElement) ByteInterval
- type ByteOrder
- type LogLevel
- type Logger
- type NewConnectionID
- type NewConnectionIDElement
- type NewConnectionIDList
- func (l *NewConnectionIDList) Back() *NewConnectionIDElement
- func (l *NewConnectionIDList) Front() *NewConnectionIDElement
- func (l *NewConnectionIDList) Init() *NewConnectionIDList
- func (l *NewConnectionIDList) InsertAfter(v NewConnectionID, mark *NewConnectionIDElement) *NewConnectionIDElement
- func (l *NewConnectionIDList) InsertBefore(v NewConnectionID, mark *NewConnectionIDElement) *NewConnectionIDElement
- func (l *NewConnectionIDList) Len() int
- func (l *NewConnectionIDList) MoveAfter(e, mark *NewConnectionIDElement)
- func (l *NewConnectionIDList) MoveBefore(e, mark *NewConnectionIDElement)
- func (l *NewConnectionIDList) MoveToBack(e *NewConnectionIDElement)
- func (l *NewConnectionIDList) MoveToFront(e *NewConnectionIDElement)
- func (l *NewConnectionIDList) PushBack(v NewConnectionID) *NewConnectionIDElement
- func (l *NewConnectionIDList) PushBackList(other *NewConnectionIDList)
- func (l *NewConnectionIDList) PushFront(v NewConnectionID) *NewConnectionIDElement
- func (l *NewConnectionIDList) PushFrontList(other *NewConnectionIDList)
- func (l *NewConnectionIDList) Remove(e *NewConnectionIDElement) NewConnectionID
- type PacketInterval
- type PacketIntervalElement
- type PacketIntervalList
- func (l *PacketIntervalList) Back() *PacketIntervalElement
- func (l *PacketIntervalList) Front() *PacketIntervalElement
- func (l *PacketIntervalList) Init() *PacketIntervalList
- func (l *PacketIntervalList) InsertAfter(v PacketInterval, mark *PacketIntervalElement) *PacketIntervalElement
- func (l *PacketIntervalList) InsertBefore(v PacketInterval, mark *PacketIntervalElement) *PacketIntervalElement
- func (l *PacketIntervalList) Len() int
- func (l *PacketIntervalList) MoveAfter(e, mark *PacketIntervalElement)
- func (l *PacketIntervalList) MoveBefore(e, mark *PacketIntervalElement)
- func (l *PacketIntervalList) MoveToBack(e *PacketIntervalElement)
- func (l *PacketIntervalList) MoveToFront(e *PacketIntervalElement)
- func (l *PacketIntervalList) PushBack(v PacketInterval) *PacketIntervalElement
- func (l *PacketIntervalList) PushBackList(other *PacketIntervalList)
- func (l *PacketIntervalList) PushFront(v PacketInterval) *PacketIntervalElement
- func (l *PacketIntervalList) PushFrontList(other *PacketIntervalList)
- func (l *PacketIntervalList) Remove(e *PacketIntervalElement) PacketInterval
- type RTTStats
- func (r *RTTStats) ExpireSmoothedMetrics()
- func (r *RTTStats) LatestRTT() time.Duration
- func (r *RTTStats) MaxAckDelay() time.Duration
- func (r *RTTStats) MeanDeviation() time.Duration
- func (r *RTTStats) MinRTT() time.Duration
- func (r *RTTStats) OnConnectionMigration()
- func (r *RTTStats) PTO(includeMaxAckDelay bool) time.Duration
- func (r *RTTStats) SetInitialRTT(t time.Duration)
- func (r *RTTStats) SetMaxAckDelay(mad time.Duration)
- func (r *RTTStats) SmoothedRTT() time.Duration
- func (r *RTTStats) UpdateRTT(sendDelta, ackDelay time.Duration, now time.Time)
- type Rand
- type Timer
Constants ¶
const InfDuration = time.Duration(math.MaxInt64)
InfDuration is a duration of infinite length
Variables ¶
This section is empty.
Functions ¶
func AbsDuration ¶
AbsDuration returns the absolute value of a time duration
func MaxByteCount ¶
MaxByteCount returns the maximum of two ByteCounts
func MaxDuration ¶
MaxDuration returns the max duration
func MaxPacketNumber ¶
func MaxPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
MaxPacketNumber returns the max packet number
func MinByteCount ¶
MinByteCount returns the minimum of two ByteCounts
func MinDuration ¶
MinDuration returns the minimum duration
func MinNonZeroDuration ¶
MinNonZeroDuration return the minimum duration that's not zero.
func MinNonZeroTime ¶
MinNonZeroTime returns the earlist time that is not time.Time{} If both a and b are time.Time{}, it returns time.Time{}
func MinPacketNumber ¶
func MinPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
MinPacketNumber returns the min packet number
func NewBufferedWriteCloser ¶
NewBufferedWriteCloser creates an io.WriteCloser from a bufio.Writer and an io.Closer
Types ¶
type AtomicBool ¶
type AtomicBool struct {
// contains filtered or unexported fields
}
An AtomicBool is an atomic bool
type ByteInterval ¶
ByteInterval is an interval from one ByteCount to the other
type ByteIntervalElement ¶
type ByteIntervalElement struct { // The value stored with this element. Value ByteInterval // contains filtered or unexported fields }
ByteIntervalElement is an element of a linked list.
func (*ByteIntervalElement) Next ¶
func (e *ByteIntervalElement) Next() *ByteIntervalElement
Next returns the next list element or nil.
func (*ByteIntervalElement) Prev ¶
func (e *ByteIntervalElement) Prev() *ByteIntervalElement
Prev returns the previous list element or nil.
type ByteIntervalList ¶
type ByteIntervalList struct {
// contains filtered or unexported fields
}
ByteIntervalList is a linked list of ByteIntervals.
func NewByteIntervalList ¶
func NewByteIntervalList() *ByteIntervalList
NewByteIntervalList returns an initialized list.
func (*ByteIntervalList) Back ¶
func (l *ByteIntervalList) Back() *ByteIntervalElement
Back returns the last element of list l or nil if the list is empty.
func (*ByteIntervalList) Front ¶
func (l *ByteIntervalList) Front() *ByteIntervalElement
Front returns the first element of list l or nil if the list is empty.
func (*ByteIntervalList) Init ¶
func (l *ByteIntervalList) Init() *ByteIntervalList
Init initializes or clears list l.
func (*ByteIntervalList) InsertAfter ¶
func (l *ByteIntervalList) InsertAfter(v ByteInterval, mark *ByteIntervalElement) *ByteIntervalElement
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*ByteIntervalList) InsertBefore ¶
func (l *ByteIntervalList) InsertBefore(v ByteInterval, mark *ByteIntervalElement) *ByteIntervalElement
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*ByteIntervalList) Len ¶
func (l *ByteIntervalList) Len() int
Len returns the number of elements of list l. The complexity is O(1).
func (*ByteIntervalList) MoveAfter ¶
func (l *ByteIntervalList) MoveAfter(e, mark *ByteIntervalElement)
MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*ByteIntervalList) MoveBefore ¶
func (l *ByteIntervalList) MoveBefore(e, mark *ByteIntervalElement)
MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*ByteIntervalList) MoveToBack ¶
func (l *ByteIntervalList) MoveToBack(e *ByteIntervalElement)
MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*ByteIntervalList) MoveToFront ¶
func (l *ByteIntervalList) MoveToFront(e *ByteIntervalElement)
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*ByteIntervalList) PushBack ¶
func (l *ByteIntervalList) PushBack(v ByteInterval) *ByteIntervalElement
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*ByteIntervalList) PushBackList ¶
func (l *ByteIntervalList) PushBackList(other *ByteIntervalList)
PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same. They must not be nil.
func (*ByteIntervalList) PushFront ¶
func (l *ByteIntervalList) PushFront(v ByteInterval) *ByteIntervalElement
PushFront inserts a new element e with value v at the front of list l and returns e.
func (*ByteIntervalList) PushFrontList ¶
func (l *ByteIntervalList) PushFrontList(other *ByteIntervalList)
PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same. They must not be nil.
func (*ByteIntervalList) Remove ¶
func (l *ByteIntervalList) Remove(e *ByteIntervalElement) ByteInterval
Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.
type ByteOrder ¶
type ByteOrder interface { ReadUint32(io.ByteReader) (uint32, error) ReadUint24(io.ByteReader) (uint32, error) ReadUint16(io.ByteReader) (uint16, error) WriteUint32(*bytes.Buffer, uint32) WriteUint24(*bytes.Buffer, uint32) WriteUint16(*bytes.Buffer, uint16) }
A ByteOrder specifies how to convert byte sequences into 16-, 32-, or 64-bit unsigned integers.
var BigEndian ByteOrder = bigEndian{}
BigEndian is the big-endian implementation of ByteOrder.
type Logger ¶
type Logger interface { SetLogLevel(LogLevel) SetLogTimeFormat(format string) WithPrefix(prefix string) Logger Debug() bool Errorf(format string, args ...interface{}) Infof(format string, args ...interface{}) Debugf(format string, args ...interface{}) }
A Logger logs.
var DefaultLogger Logger
DefaultLogger is used by quic-go for logging.
type NewConnectionID ¶
type NewConnectionID struct { SequenceNumber uint64 ConnectionID protocol.ConnectionID StatelessResetToken protocol.StatelessResetToken }
NewConnectionID is a new connection ID
type NewConnectionIDElement ¶
type NewConnectionIDElement struct { // The value stored with this element. Value NewConnectionID // contains filtered or unexported fields }
NewConnectionIDElement is an element of a linked list.
func (*NewConnectionIDElement) Next ¶
func (e *NewConnectionIDElement) Next() *NewConnectionIDElement
Next returns the next list element or nil.
func (*NewConnectionIDElement) Prev ¶
func (e *NewConnectionIDElement) Prev() *NewConnectionIDElement
Prev returns the previous list element or nil.
type NewConnectionIDList ¶
type NewConnectionIDList struct {
// contains filtered or unexported fields
}
NewConnectionIDList is a linked list of NewConnectionIDs.
func NewNewConnectionIDList ¶
func NewNewConnectionIDList() *NewConnectionIDList
NewNewConnectionIDList returns an initialized list.
func (*NewConnectionIDList) Back ¶
func (l *NewConnectionIDList) Back() *NewConnectionIDElement
Back returns the last element of list l or nil if the list is empty.
func (*NewConnectionIDList) Front ¶
func (l *NewConnectionIDList) Front() *NewConnectionIDElement
Front returns the first element of list l or nil if the list is empty.
func (*NewConnectionIDList) Init ¶
func (l *NewConnectionIDList) Init() *NewConnectionIDList
Init initializes or clears list l.
func (*NewConnectionIDList) InsertAfter ¶
func (l *NewConnectionIDList) InsertAfter(v NewConnectionID, mark *NewConnectionIDElement) *NewConnectionIDElement
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*NewConnectionIDList) InsertBefore ¶
func (l *NewConnectionIDList) InsertBefore(v NewConnectionID, mark *NewConnectionIDElement) *NewConnectionIDElement
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*NewConnectionIDList) Len ¶
func (l *NewConnectionIDList) Len() int
Len returns the number of elements of list l. The complexity is O(1).
func (*NewConnectionIDList) MoveAfter ¶
func (l *NewConnectionIDList) MoveAfter(e, mark *NewConnectionIDElement)
MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*NewConnectionIDList) MoveBefore ¶
func (l *NewConnectionIDList) MoveBefore(e, mark *NewConnectionIDElement)
MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*NewConnectionIDList) MoveToBack ¶
func (l *NewConnectionIDList) MoveToBack(e *NewConnectionIDElement)
MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*NewConnectionIDList) MoveToFront ¶
func (l *NewConnectionIDList) MoveToFront(e *NewConnectionIDElement)
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*NewConnectionIDList) PushBack ¶
func (l *NewConnectionIDList) PushBack(v NewConnectionID) *NewConnectionIDElement
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*NewConnectionIDList) PushBackList ¶
func (l *NewConnectionIDList) PushBackList(other *NewConnectionIDList)
PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same. They must not be nil.
func (*NewConnectionIDList) PushFront ¶
func (l *NewConnectionIDList) PushFront(v NewConnectionID) *NewConnectionIDElement
PushFront inserts a new element e with value v at the front of list l and returns e.
func (*NewConnectionIDList) PushFrontList ¶
func (l *NewConnectionIDList) PushFrontList(other *NewConnectionIDList)
PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same. They must not be nil.
func (*NewConnectionIDList) Remove ¶
func (l *NewConnectionIDList) Remove(e *NewConnectionIDElement) NewConnectionID
Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.
type PacketInterval ¶
type PacketInterval struct { Start protocol.PacketNumber End protocol.PacketNumber }
PacketInterval is an interval from one PacketNumber to the other
type PacketIntervalElement ¶
type PacketIntervalElement struct { // The value stored with this element. Value PacketInterval // contains filtered or unexported fields }
PacketIntervalElement is an element of a linked list.
func (*PacketIntervalElement) Next ¶
func (e *PacketIntervalElement) Next() *PacketIntervalElement
Next returns the next list element or nil.
func (*PacketIntervalElement) Prev ¶
func (e *PacketIntervalElement) Prev() *PacketIntervalElement
Prev returns the previous list element or nil.
type PacketIntervalList ¶
type PacketIntervalList struct {
// contains filtered or unexported fields
}
PacketIntervalList is a linked list of PacketIntervals.
func NewPacketIntervalList ¶
func NewPacketIntervalList() *PacketIntervalList
NewPacketIntervalList returns an initialized list.
func (*PacketIntervalList) Back ¶
func (l *PacketIntervalList) Back() *PacketIntervalElement
Back returns the last element of list l or nil if the list is empty.
func (*PacketIntervalList) Front ¶
func (l *PacketIntervalList) Front() *PacketIntervalElement
Front returns the first element of list l or nil if the list is empty.
func (*PacketIntervalList) Init ¶
func (l *PacketIntervalList) Init() *PacketIntervalList
Init initializes or clears list l.
func (*PacketIntervalList) InsertAfter ¶
func (l *PacketIntervalList) InsertAfter(v PacketInterval, mark *PacketIntervalElement) *PacketIntervalElement
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*PacketIntervalList) InsertBefore ¶
func (l *PacketIntervalList) InsertBefore(v PacketInterval, mark *PacketIntervalElement) *PacketIntervalElement
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*PacketIntervalList) Len ¶
func (l *PacketIntervalList) Len() int
Len returns the number of elements of list l. The complexity is O(1).
func (*PacketIntervalList) MoveAfter ¶
func (l *PacketIntervalList) MoveAfter(e, mark *PacketIntervalElement)
MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*PacketIntervalList) MoveBefore ¶
func (l *PacketIntervalList) MoveBefore(e, mark *PacketIntervalElement)
MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*PacketIntervalList) MoveToBack ¶
func (l *PacketIntervalList) MoveToBack(e *PacketIntervalElement)
MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*PacketIntervalList) MoveToFront ¶
func (l *PacketIntervalList) MoveToFront(e *PacketIntervalElement)
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*PacketIntervalList) PushBack ¶
func (l *PacketIntervalList) PushBack(v PacketInterval) *PacketIntervalElement
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*PacketIntervalList) PushBackList ¶
func (l *PacketIntervalList) PushBackList(other *PacketIntervalList)
PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same. They must not be nil.
func (*PacketIntervalList) PushFront ¶
func (l *PacketIntervalList) PushFront(v PacketInterval) *PacketIntervalElement
PushFront inserts a new element e with value v at the front of list l and returns e.
func (*PacketIntervalList) PushFrontList ¶
func (l *PacketIntervalList) PushFrontList(other *PacketIntervalList)
PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same. They must not be nil.
func (*PacketIntervalList) Remove ¶
func (l *PacketIntervalList) Remove(e *PacketIntervalElement) PacketInterval
Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.
type RTTStats ¶
type RTTStats struct {
// contains filtered or unexported fields
}
RTTStats provides round-trip statistics
func NewRTTStats ¶
func NewRTTStats() *RTTStats
NewRTTStats makes a properly initialized RTTStats object
func (*RTTStats) ExpireSmoothedMetrics ¶
func (r *RTTStats) ExpireSmoothedMetrics()
ExpireSmoothedMetrics causes the smoothed_rtt to be increased to the latest_rtt if the latest_rtt is larger. The mean deviation is increased to the most recent deviation if it's larger.
func (*RTTStats) LatestRTT ¶
LatestRTT returns the most recent rtt measurement. May return Zero if no valid updates have occurred.
func (*RTTStats) MaxAckDelay ¶
MaxAckDelay gets the max_ack_delay advertised by the peer
func (*RTTStats) MeanDeviation ¶
MeanDeviation gets the mean deviation
func (*RTTStats) MinRTT ¶
MinRTT Returns the minRTT for the entire connection. May return Zero if no valid updates have occurred.
func (*RTTStats) OnConnectionMigration ¶
func (r *RTTStats) OnConnectionMigration()
OnConnectionMigration is called when connection migrates and rtt measurement needs to be reset.
func (*RTTStats) SetInitialRTT ¶
SetInitialRTT sets the initial RTT. It is used during the 0-RTT handshake when restoring the RTT stats from the session state.
func (*RTTStats) SetMaxAckDelay ¶
SetMaxAckDelay sets the max_ack_delay
func (*RTTStats) SmoothedRTT ¶
SmoothedRTT returns the smoothed RTT for the connection. May return Zero if no valid updates have occurred.
type Rand ¶
type Rand struct {
// contains filtered or unexported fields
}
Rand is a wrapper around crypto/rand that adds some convenience functions known from math/rand.
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
A Timer wrapper that behaves correctly when resetting