import "github.com/lucas-clemente/quic-go/internal/utils"
atomic_bool.go buffered_write_closer.go byteinterval_linkedlist.go byteorder.go byteorder_big_endian.go gen.go ip.go log.go minmax.go new_connection_id.go newconnectionid_linkedlist.go packet_interval.go packetinterval_linkedlist.go rtt_stats.go streamframe_interval.go timer.go
InfDuration is a duration of infinite length
AbsDuration returns the absolute value of a time duration
Max returns the maximum of two Ints
MaxByteCount returns the maximum of two ByteCounts
MaxDuration returns the max duration
MaxInt64 returns the minimum of two int64
func MaxPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
MaxPacketNumber returns the max packet number
MaxTime returns the later time
MaxUint32 returns the maximum of two uint32
MaxUint64 returns the maximum of two uint64
Min returns the minimum of two Ints
MinByteCount returns the minimum of two ByteCounts
MinDuration returns the minimum duration
MinInt64 returns the minimum of two int64
MinNonZeroDuration return the minimum duration that's not zero.
MinNonZeroTime returns the earlist time that is not time.Time{} If both a and b are time.Time{}, it returns time.Time{}
func MinPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
MinPacketNumber returns the min packet number
MinTime returns the earlier time
MinUint32 returns the maximum of two uint32
MinUint64 returns the maximum of two uint64
NewBufferedWriteCloser creates an io.WriteCloser from a bufio.Writer and an io.Closer
type AtomicBool struct {
// contains filtered or unexported fields
}
An AtomicBool is an atomic bool
func (a *AtomicBool) Get() bool
Get gets the value
func (a *AtomicBool) Set(value bool)
Set sets the value
ByteInterval is an interval from one ByteCount to the other
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 (e *ByteIntervalElement) Next() *ByteIntervalElement
Next returns the next list element or nil.
func (e *ByteIntervalElement) Prev() *ByteIntervalElement
Prev returns the previous list element or nil.
type ByteIntervalList struct {
// contains filtered or unexported fields
}
ByteIntervalList is a linked list of ByteIntervals.
func NewByteIntervalList() *ByteIntervalList
NewByteIntervalList returns an initialized list.
func (l *ByteIntervalList) Back() *ByteIntervalElement
Back returns the last element of list l or nil if the list is empty.
func (l *ByteIntervalList) Front() *ByteIntervalElement
Front returns the first element of list l or nil if the list is empty.
func (l *ByteIntervalList) Init() *ByteIntervalList
Init initializes or clears list l.
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 (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 (l *ByteIntervalList) Len() int
Len returns the number of elements of list l. The complexity is O(1).
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 (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 (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 (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 (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 (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 (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 (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 (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 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.
BigEndian is the big-endian implementation of ByteOrder.
LogLevel of quic-go
const ( // LogLevelNothing disables LogLevelNothing LogLevel = iota // LogLevelError enables err logs LogLevelError // LogLevelInfo enables info logs (e.g. packets) LogLevelInfo // LogLevelDebug enables debug logs (e.g. packet contents) LogLevelDebug )
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.
DefaultLogger is used by quic-go for logging.
type NewConnectionID struct { SequenceNumber uint64 ConnectionID protocol.ConnectionID StatelessResetToken protocol.StatelessResetToken }
NewConnectionID is a new connection ID
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 (e *NewConnectionIDElement) Next() *NewConnectionIDElement
Next returns the next list element or nil.
func (e *NewConnectionIDElement) Prev() *NewConnectionIDElement
Prev returns the previous list element or nil.
type NewConnectionIDList struct {
// contains filtered or unexported fields
}
NewConnectionIDList is a linked list of NewConnectionIDs.
func NewNewConnectionIDList() *NewConnectionIDList
NewNewConnectionIDList returns an initialized list.
func (l *NewConnectionIDList) Back() *NewConnectionIDElement
Back returns the last element of list l or nil if the list is empty.
func (l *NewConnectionIDList) Front() *NewConnectionIDElement
Front returns the first element of list l or nil if the list is empty.
func (l *NewConnectionIDList) Init() *NewConnectionIDList
Init initializes or clears list l.
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 (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 (l *NewConnectionIDList) Len() int
Len returns the number of elements of list l. The complexity is O(1).
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 (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 (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 (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 (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 (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 (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 (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 (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 struct { Start protocol.PacketNumber End protocol.PacketNumber }
PacketInterval is an interval from one PacketNumber to the other
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 (e *PacketIntervalElement) Next() *PacketIntervalElement
Next returns the next list element or nil.
func (e *PacketIntervalElement) Prev() *PacketIntervalElement
Prev returns the previous list element or nil.
type PacketIntervalList struct {
// contains filtered or unexported fields
}
PacketIntervalList is a linked list of PacketIntervals.
func NewPacketIntervalList() *PacketIntervalList
NewPacketIntervalList returns an initialized list.
func (l *PacketIntervalList) Back() *PacketIntervalElement
Back returns the last element of list l or nil if the list is empty.
func (l *PacketIntervalList) Front() *PacketIntervalElement
Front returns the first element of list l or nil if the list is empty.
func (l *PacketIntervalList) Init() *PacketIntervalList
Init initializes or clears list l.
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 (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 (l *PacketIntervalList) Len() int
Len returns the number of elements of list l. The complexity is O(1).
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 (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 (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 (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 (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 (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 (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 (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 (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 struct {
// contains filtered or unexported fields
}
RTTStats provides round-trip statistics
NewRTTStats makes a properly initialized RTTStats object
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.
LatestRTT returns the most recent rtt measurement. May return Zero if no valid updates have occurred.
MaxAckDelay gets the max_ack_delay advertised by the peer
MeanDeviation gets the mean deviation
MinRTT Returns the minRTT for the entire connection. May return Zero if no valid updates have occurred.
OnConnectionMigration is called when connection migrates and rtt measurement needs to be reset.
PTO gets the probe timeout duration.
SetInitialRTT sets the initial RTT. It is used during the 0-RTT handshake when restoring the RTT stats from the session state.
SetMaxAckDelay sets the max_ack_delay
SmoothedRTT returns the smoothed RTT for the connection. May return Zero if no valid updates have occurred.
UpdateRTT updates the RTT based on a new sample.
type Timer struct {
// contains filtered or unexported fields
}
A Timer wrapper that behaves correctly when resetting
NewTimer creates a new timer that is not set
Chan returns the channel of the wrapped timer
Reset the timer, no matter whether the value was read or not
SetRead should be called after the value from the chan was read
Stop stops the timer
Path | Synopsis |
---|---|
linkedlist |
Package utils imports 12 packages (graph) and is imported by 86 packages. Updated 2021-01-27. Refresh now. Tools for package owners.