decorators

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package decorators provides cache decorators for cross-cutting concerns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder composes decorators around a base ByteCache.

func NewBuilder

func NewBuilder(base interfaces.ByteCache, name string) *Builder

NewBuilder creates a new decorator builder wrapping the given base cache.

func (*Builder) Build

func (b *Builder) Build() interfaces.ByteCache

Build constructs the decorated cache. Decorators are applied inside-out: base -> metrics (metrics is outermost).

func (*Builder) WithMetrics

func (b *Builder) WithMetrics(m interfaces.Metrics) *Builder

WithMetrics adds a metrics decorator that records hits, misses, and operation durations via the interfaces.Metrics abstraction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL