Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Items ¶
type Items[T any] struct { // contains filtered or unexported fields }
Items keeps track of a set of Items (with a Value and Weight), up to a fixed capacity, only retaining the highest weights (>= minMatch).
func NewItems ¶
NewItems returns a structure which tracks the top-weighted Items, subject to minMatch and a fixed capacity.
func (*Items[T]) Add ¶
Add inserts an Item if it meets the minMatch threshold, ensuring we only keep the top N items by Weight.
func (*Items[T]) AddLocal ¶ added in v0.65.0
AddLocal is like Add but without locking. Safe only when a single goroutine owns the Items instance (e.g. a per-worker local top-K buffer).
Click to show internal directories.
Click to hide internal directories.