Versions in this module Expand all Collapse all v0 v0.2.1 Jul 28, 2026 v0.2.0 Jul 28, 2026 Changes in this version + func TruncateText(s string, max int) (string, bool) + type Buffer struct + func New[T any](max int) *Buffer[T] + func (b *Buffer[T]) Add(e T) + func (b *Buffer[T]) Clear() + func (b *Buffer[T]) Dropped() int + func (b *Buffer[T]) Len() int + func (b *Buffer[T]) Query(q Query[T]) Result[T] + func (b *Buffer[T]) Subscribe(fn func(T)) (stop func()) + func (b *Buffer[T]) Upsert(key string, mutate func(cur T, existed bool) T) T + type Query struct + Clear bool + Keep func(T) bool + Limit int + type Result struct + Buffered int + Count int + Dropped int + Entries []T + Truncated bool + type Set struct + func NewSet[T any](perTarget, total int) *Set[T] + func (s *Set[T]) Add(targetID string, e T) + func (s *Set[T]) Buffer(targetID string) *Buffer[T] + func (s *Set[T]) Clear(targetID string) + func (s *Set[T]) Forget(targetID string) + func (s *Set[T]) Query(targetID string, q Query[T]) Result[T] + func (s *Set[T]) Stat(targetID string) (buffered, dropped int) + func (s *Set[T]) Subscribe(targetID string, fn func(T)) (stop func()) + func (s *Set[T]) Targets() []string + func (s *Set[T]) Total() int + func (s *Set[T]) Upsert(targetID, key string, mutate func(cur T, existed bool) T) T