contextcache

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context) context.Context

NewContext attaches a memory cache to the provided context.

Types

type Context

type Context struct{}

Context provides a request/context-level cache.

func New

func New() *Context

New returns a new context-level cache level.

func (*Context) Add

func (c *Context) Add(ctx context.Context, k entcache.Key, e *entcache.Entry, ttl time.Duration) error

Add adds an entry to the context-level cache.

func (*Context) Del

func (c *Context) Del(ctx context.Context, k entcache.Key) error

Del deletes an entry from the context-level cache.

func (*Context) Get

func (c *Context) Get(ctx context.Context, k entcache.Key) (*entcache.Entry, error)

Get gets an entry from the context-level cache.

func (*Context) LockOrWait

func (c *Context) LockOrWait(ctx context.Context, k entcache.Key) (bool, func(context.Context) (*entcache.Entry, error), func(context.Context), error)

LockOrWait implements StampedeLocker interface for context-level cache.

Jump to

Keyboard shortcuts

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