Versions in this module Expand all Collapse all v0 v0.2.0 Apr 18, 2026 v0.1.3 Dec 16, 2025 Changes in this version + var GlobalBufferAdapter = NewBufferPoolAdapter() + var GlobalPoolMigrationManager = NewPoolMigrationManager() + var GlobalSmartStringPool = NewSmartStringBuilderPool() + var GlobalTieredPools = NewTieredPools() + func AnyValueToString(v slog.Value) string + func AppendAttrsToGroup(groups []string, actualAttrs []slog.Attr, newAttrs ...slog.Attr) []slog.Attr + func AppendRecordAttrsToAttrs(attrs []slog.Attr, groups []string, record *slog.Record) []slog.Attr + func AttrToValue(attr slog.Attr) (string, any) + func AttrsToMap(attrs ...slog.Attr) map[string]any + func AttrsToString(attrs ...slog.Attr) map[string]string + func Contains[T comparable](collection []T, element T) bool + func ContextExtractor(ctx context.Context, fns []func(ctx context.Context) []slog.Attr) []slog.Attr + func ExtractError(attrs []slog.Attr, errorKeys ...string) ([]slog.Attr, error) + func ExtractFromContext(keys ...any) func(ctx context.Context) []slog.Attr + func FilterMap[T any, R any](collection []T, callback func(item T, index int) (R, bool)) []R + func FindAttrByGroupAndKey(attrs []slog.Attr, groups []string, key string) (slog.Attr, bool) + func FindAttrByKey(attrs []slog.Attr, key string) (slog.Attr, bool) + func FindAttribute(attrs []slog.Attr, groups []string, key string) (slog.Attr, bool) + func FormatError(err error) map[string]any + func FormatErrorKey(values map[string]any, errorKeys ...string) map[string]any + func FormatRequest(req *http.Request, ignoreHeaders bool) map[string]any + func GetLargeStringBuilder() *strings.Builder + func GetMediumStringBuilder() *strings.Builder + func GetSmallStringBuilder() *strings.Builder + func GetSmartStringBuilder() *strings.Builder + func MapEntries[K1 comparable, V1 any, K2 comparable, V2 any](in map[K1]V1, iteratee func(key K1, value V1) (K2, V2)) map[K2]V2 + func MapToSlice[K comparable, V any, R any](in map[K]V, iteratee func(key K, value V) R) []R + func Map[T any, R any](collection []T, iteratee func(item T, index int) R) []R + func PutBuffer(buffer *TieredBuffer) + func PutSmartStringBuilder(builder *strings.Builder) + func PutStringBuilder(builder *strings.Builder) + func ReleaseBuffer(buffer *TieredBuffer) + func RemoveEmptyAttrs(attrs []slog.Attr) []slog.Attr + func ReplaceAttrs(fn ReplaceAttrFn, groups []string, attrs ...slog.Attr) []slog.Attr + func ReplaceError(attrs []slog.Attr, errorKeys ...string) []slog.Attr + func Source(sourceKey string, r *slog.Record) slog.Attr + func StringSource(sourceKey string, r *slog.Record) slog.Attr + func ToAnySlice[T any](collection []T) []any + func UniqAttrs(attrs []slog.Attr) []slog.Attr + func ValueToString(v slog.Value) string + type BufferPool struct + func NewBufferPool(initSize, maxSize int, stats *PoolStats) *BufferPool + type BufferPoolAdapter struct + func NewBufferPoolAdapter() *BufferPoolAdapter + func (bpa *BufferPoolAdapter) AdaptExistingBuffer(data []byte) *TieredBuffer + func (bpa *BufferPoolAdapter) GetAdapterStats() (gets, puts int64) + func (bpa *BufferPoolAdapter) ReleaseAdaptedBuffer(buffer *TieredBuffer) + type BufferPoolStats struct + Discards int64 + Gets int64 + HitRate float64 + News int64 + PoolSize int + Puts int64 + type BufferSize int + const LargeBuffer + const MediumBuffer + const SmallBuffer + type CacheEntry struct + Key interface{} + Value interface{} + type LRUCache struct + func NewLRUCache(capacity int) *LRUCache + func NewLRUCacheWithOptions(options ...LRUCacheOption) *LRUCache + func (lru *LRUCache) Capacity() int + func (lru *LRUCache) Clear() + func (lru *LRUCache) Contains(key interface{}) bool + func (lru *LRUCache) Get(key interface{}) (interface{}, bool) + func (lru *LRUCache) GetKeys() []interface{} + func (lru *LRUCache) GetMostRecentKey() interface{} + func (lru *LRUCache) GetOldestKey() interface{} + func (lru *LRUCache) GetStats() LRUCacheStats + func (lru *LRUCache) Peek(key interface{}) (interface{}, bool) + func (lru *LRUCache) Put(key interface{}, value interface{}) + func (lru *LRUCache) Remove(key interface{}) bool + func (lru *LRUCache) SetCapacity(capacity int) + func (lru *LRUCache) Size() int + type LRUCacheOption func(*LRUCache) + func WithCapacity(capacity int) LRUCacheOption + type LRUCacheStats struct + Capacity int + HitRate float64 + Hits int64 + Misses int64 + Size int + type LRUStringCache struct + func NewLRUStringCache(capacity int) *LRUStringCache + func (lsc *LRUStringCache) GetString(key string) (string, bool) + func (lsc *LRUStringCache) GetStringKeys() []string + func (lsc *LRUStringCache) PutString(key string, value string) + type PoolMigrationManager struct + func NewPoolMigrationManager() *PoolMigrationManager + func (pm *PoolMigrationManager) MigrateStringBuilderPool(oldPool *sync.Pool) *TieredStringBuilderPool + type PoolStats struct + func (ps *PoolStats) Discards() int64 + func (ps *PoolStats) Gets() int64 + func (ps *PoolStats) News() int64 + func (ps *PoolStats) Puts() int64 + type ReplaceAttrFn = func(groups []string, a slog.Attr) slog.Attr + type SmartStringBuilderPool struct + func NewSmartStringBuilderPool() *SmartStringBuilderPool + func (ssp *SmartStringBuilderPool) GetOptimal() *strings.Builder + func (ssp *SmartStringBuilderPool) GetUsageStats() (small, medium, large int64) + func (ssp *SmartStringBuilderPool) PutWithUsageTracking(builder *strings.Builder) + type StringBuilderPool struct + func NewStringBuilderPool(capacity int, stats *PoolStats) *StringBuilderPool + type TieredBuffer struct + func AdaptBuffer(data []byte) *TieredBuffer + func GetLargeBuffer() *TieredBuffer + func GetMediumBuffer() *TieredBuffer + func GetSmallBuffer() *TieredBuffer + func (tb *TieredBuffer) Bytes() []byte + func (tb *TieredBuffer) Cap() int + func (tb *TieredBuffer) Len() int + func (tb *TieredBuffer) Reset() + func (tb *TieredBuffer) Size() BufferSize + func (tb *TieredBuffer) String() string + func (tb *TieredBuffer) Write(p []byte) (n int, err error) + func (tb *TieredBuffer) WriteString(s string) (n int, err error) + type TieredPools struct + func NewTieredPools() *TieredPools + func (tp *TieredPools) GetBuffer(expectedSize int) *TieredBuffer + func (tp *TieredPools) GetStats() map[BufferSize]BufferPoolStats + func (tp *TieredPools) GetStringBuilder(expectedCapacity int) *strings.Builder + func (tp *TieredPools) PutBuffer(buffer *TieredBuffer) + func (tp *TieredPools) PutStringBuilder(builder *strings.Builder, expectedCapacity int) + type TieredStringBuilderPool struct + func MigrateStringPool(oldPool *sync.Pool) *TieredStringBuilderPool + func (tsp *TieredStringBuilderPool) Get() interface{} + func (tsp *TieredStringBuilderPool) GetWithCapacity(expectedCapacity int) *strings.Builder + func (tsp *TieredStringBuilderPool) Put(x interface{}) + func (tsp *TieredStringBuilderPool) PutWithCapacity(builder *strings.Builder, expectedCapacity int)