Documentation
¶
Overview ¶
Package ringlog contains a limited-size concurrency-safe generic ring log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RingLog ¶
type RingLog[T any] struct { // contains filtered or unexported fields }
RingLog is a concurrency-safe fixed size log window containing entries of [T].
func (*RingLog[T]) Add ¶
func (rb *RingLog[T]) Add(t T)
Add appends a new item to the RingLog, possibly overwriting the oldest item in the log if it is already full.
It does nothing if rb is nil.
func (*RingLog[T]) Clear ¶
func (rb *RingLog[T]) Clear()
Clear will empty the ring log.
It does nothing if rb is nil.
Click to show internal directories.
Click to hide internal directories.