Help us shape the future of Go! Take the 2026 Go Developer Survey

decorators

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 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