cache

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, value []byte, timeout time.Duration) error
	Del(ctx context.Context, key string) error
}

Cache interface for storing bytes with TTL

func NewCache

func NewCache() Cache

NewCache returns a new Cache that will store items in in-memory

type CacheModule

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

CacheModule provides in-memory caching with TTL support

func NewCacheModule

func NewCacheModule() *CacheModule

NewCacheModule creates a new cache module

func (*CacheModule) Cleanup

func (c *CacheModule) Cleanup() error

Cleanup performs any necessary cleanup

func (*CacheModule) CreateModuleObject

func (c *CacheModule) CreateModuleObject(runtime *sobek.Runtime) sobek.Value

CreateModuleObject creates the cache object when required

func (*CacheModule) IsEnabled

func (c *CacheModule) IsEnabled(enabledModules map[string]bool) bool

IsEnabled checks if the module should be enabled based on configuration

func (*CacheModule) Name

func (c *CacheModule) Name() string

Name returns the module name

func (*CacheModule) Setup

func (c *CacheModule) Setup(runtime *sobek.Runtime, manager *vm.VMManager) error

Setup initializes the cache module in the VM

Jump to

Keyboard shortcuts

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