
The highest tagged major version is
v4.
package
Version:
v3.10.63
Opens a new window with list of versions in this module.
Published: Apr 22, 2024
License: 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
Since returns 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 {
Timestamp time.Time
Value interface{}
}
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.