package buffer
import "k8s.io/utils/buffer"
Index ¶
Types ¶
type RingGrowing ¶
type RingGrowing struct {
// contains filtered or unexported fields
}
RingGrowing is a growing ring buffer. Not thread safe.
func NewRingGrowing ¶
func NewRingGrowing(initialSize int) *RingGrowing
NewRingGrowing constructs a new RingGrowing instance with provided parameters.
func (*RingGrowing) Cap ¶
func (r *RingGrowing) Cap() int
Cap returns the capacity of the buffer.
func (*RingGrowing) Len ¶
func (r *RingGrowing) Len() int
Len returns the number of items in the buffer.
func (*RingGrowing) ReadOne ¶
func (r *RingGrowing) ReadOne() (data interface{}, ok bool)
ReadOne reads (consumes) first item from the buffer if it is available, otherwise returns false.
func (*RingGrowing) WriteOne ¶
func (r *RingGrowing) WriteOne(data interface{})
WriteOne adds an item to the end of the buffer, growing it if it is full.
Source Files ¶
ring_growing.go
- Version
- v0.0.0-20250321185631-1f6e0b77f77e (latest)
- Published
- Mar 21, 2025
- Platform
- js/wasm
- Last checked
- 3 weeks ago –
Tools for package owners.