package
Version:
v0.2.9
Opens a new window with list of versions in this module.
Published: Oct 18, 2024
License: MIT, Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package ring provides a simple ring buffer for storing local data
Buffer is ring buffer
New returns a new buffer of the given size
Get returns the last n entries
func (b *Buffer) Put(v interface{})
Put adds a new value to ring buffer
Return the entries since a specific time
Size returns the size of the ring buffer
Stream logs from the buffer
Close the channel when you want to stop
type Entry struct {
Value interface{}
Timestamp time.Time
}
Entry is ring buffer data entry
Stream is used to stream the buffer
Source Files
¶
Click to show internal directories.
Click to hide internal directories.