Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StringRing ¶
type StringRing struct {
// contains filtered or unexported fields
}
StringRing stores the last N strings passed to Put(). It is thread-safe.
func NewStringRing ¶
func NewStringRing(capacity int) *StringRing
NewStringRing returns a StringRing with the given capacity. Panics if the capacity is negative.
func (*StringRing) GetAll ¶
func (r *StringRing) GetAll() []string
GetAll returns all values stored in the ring.
func (*StringRing) Put ¶
func (r *StringRing) Put(s string)
Put appends the given value to the ring, possibly overwriting a previous value.
Click to show internal directories.
Click to hide internal directories.