gocache

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gocache instruments github.com/levskiy0/go-cache operations and locks as webpprof cache entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache = cachecontract.Cache

Cache aliases the go-cache facade accepted by Profile.

func Profile

func Profile(cache Cache, stores ...string) Cache

Profile instruments cache with the default profiler.

func ProfileWith

func ProfileWith(profiler *webpprof.Profiler, cache Cache, stores ...string) Cache

ProfileWith instruments cache with an explicit profiler.

type CacheDriver

type CacheDriver = cachecontract.Driver

CacheDriver aliases the go-cache driver wrapped by the integration.

type Lock

type Lock = cachecontract.Lock

Lock aliases the go-cache lock contract returned by instrumented drivers.

type ProfilerGoCache

type ProfilerGoCache struct {
	Store string
}

ProfilerGoCache implements webpprof.Integration for go-cache instances.

func New

func New(stores ...string) ProfilerGoCache

New creates a go-cache integration. The first non-empty store name is shown in captured entries; it defaults to "default".

func (ProfilerGoCache) Name

func (ProfilerGoCache) Name() string

Name returns the integration cache namespace.

func (ProfilerGoCache) Profile

func (d ProfilerGoCache) Profile(scope webpprof.Scope, cache Cache) Cache

Profile wraps cache so operations and locks are recorded. Wrapping is idempotent for the same profiler.

Jump to

Keyboard shortcuts

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