...

Package buffer

import "k8s.io/utils/buffer"
Overview
Index

Overview ▾

type RingGrowing

RingGrowing is a growing ring buffer. Not thread safe.

type RingGrowing struct {
    // contains filtered or unexported fields
}

func NewRingGrowing

func NewRingGrowing(initialSize int) *RingGrowing

NewRingGrowing constructs a new RingGrowing instance with provided parameters.

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.