Documentation ¶
Index ¶
- Constants
- func AbsDuration(d time.Duration) time.Duration
- func Debug() bool
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func Max(a, b int) int
- func MaxDuration(a, b time.Duration) time.Duration
- func MaxInt64(a, b int64) int64
- func MaxPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
- 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 MinPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
- func MinTime(a, b time.Time) time.Time
- func MinUint32(a, b uint32) uint32
- func RandomBit() (bool, error)
- func ReadUfloat16(b io.ByteReader) (uint64, error)
- func ReadUint16(b io.ByteReader) (uint16, error)
- func ReadUint32(b io.ByteReader) (uint32, error)
- func ReadUint64(b io.ByteReader) (uint64, error)
- func ReadUintN(b io.ByteReader, length uint8) (uint64, error)
- func SetLogLevel(level LogLevel)
- func SetLogWriter(w io.Writer)
- func WriteUfloat16(b *bytes.Buffer, value uint64)
- func WriteUint16(b *bytes.Buffer, i uint16)
- func WriteUint24(b *bytes.Buffer, i uint32)
- func WriteUint32(b *bytes.Buffer, i uint32)
- func WriteUint40(b *bytes.Buffer, i uint64)
- func WriteUint48(b *bytes.Buffer, i uint64)
- func WriteUint56(b *bytes.Buffer, i uint64)
- func WriteUint64(b *bytes.Buffer, i uint64)
- 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 CachingReader
- type LogLevel
- type ReadStream
- type RingBuffer
- type Stream
- type Uint32Slice
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 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 MinPacketNumber ¶
func MinPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber
MinPacketNumber returns the min packet number
func ReadUfloat16 ¶
func ReadUfloat16(b io.ByteReader) (uint64, error)
ReadUfloat16 reads a float in the QUIC-float16 format and returns its uint64 representation
func ReadUintN ¶
func ReadUintN(b io.ByteReader, length uint8) (uint64, error)
ReadUintN reads N bytes
func WriteUfloat16 ¶
WriteUfloat16 writes a float in the QUIC-float16 format from its uint64 representation
func WriteUint24 ¶
WriteUint24 writes 24 bit of a uint32
func WriteUint40 ¶
WriteUint40 writes 40 bit of a uint64
func WriteUint48 ¶
WriteUint48 writes 48 bit of a uint64
func WriteUint56 ¶
WriteUint56 writes 56 bit of a uint64
Types ¶
type ByteInterval ¶
ByteInterval is an interval from one ByteCount to the other +gen linkedlist
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 represents a doubly linked list. The zero value for ByteIntervalList is an empty list ready to use.
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.
func (*ByteIntervalList) Front ¶
func (l *ByteIntervalList) Front() *ByteIntervalElement
Front returns the first element of list l or nil.
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.
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.
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 is not an element of l, or e == mark, the list is not modified.
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.
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.
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.
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.
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.
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.
type CachingReader ¶
type CachingReader struct {
// contains filtered or unexported fields
}
CachingReader wraps a reader and saves all data it reads
func NewCachingReader ¶
func NewCachingReader(r ReadStream) *CachingReader
NewCachingReader returns a new CachingReader
func (*CachingReader) Read ¶
func (r *CachingReader) Read(p []byte) (int, error)
Read implements io.Reader
func (*CachingReader) ReadByte ¶
func (r *CachingReader) ReadByte() (byte, error)
ReadByte implements io.ByteReader
type ReadStream ¶
type ReadStream interface { io.Reader io.ByteReader }
ReadStream is the read part of a QUIC stream
type RingBuffer ¶
type RingBuffer interface { Write(p []byte, offset uint64) error Read(n uint64) ([]byte, uint64, error) Clear(n uint64) error Len() uint64 }
RingBuffer is a ring buffer
func NewRingBuffer ¶
func NewRingBuffer(length uint64) RingBuffer
NewRingBuffer creates a new ring buffer
type Stream ¶
type Stream interface { io.Reader io.ByteReader io.Writer io.Closer StreamID() protocol.StreamID CloseRemote(offset protocol.ByteCount) }
Stream is the interface for QUIC streams
type Uint32Slice ¶
type Uint32Slice []uint32
Uint32Slice attaches the methods of sort.Interface to []uint32, sorting in increasing order.
func (Uint32Slice) Len ¶
func (s Uint32Slice) Len() int
func (Uint32Slice) Less ¶
func (s Uint32Slice) Less(i, j int) bool
func (Uint32Slice) Swap ¶
func (s Uint32Slice) Swap(i, j int)