package ringbuffer
Import Path
github.com/quic-go/quic-go/internal/utils/ringbuffer (on go.dev)
Dependency Relation
imports 0 packages, and imported by one package
Involved Source Files
ringbuffer.go
Package-Level Type Names (only one)
Type Parameters:
T: any
A RingBuffer is a ring buffer.
It acts as a heap that doesn't cause any allocations.
Clear removes all elements.
Empty says if the ring buffer is empty.
Init preallocates a buffer with a certain size.
Len returns the number of elements in the ring buffer.
PeekFront returns the next element.
It must not be called when the buffer is empty, that means that
callers might need to check if there are elements in the buffer first.
PopFront returns the next element.
It must not be called when the buffer is empty, that means that
callers might need to check if there are elements in the buffer first.
PushBack adds a new element.
If the ring buffer is full, its capacity is increased first.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |