cache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cache the cache JS implementation

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
}

A Cache interface is used to store bytes.

func NewCache

func NewCache() Cache

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

type Module

type Module struct{ Cache }

Module is used to store string or bytes.

func (*Module) Del

func (c *Module) Del(call sobek.FunctionCall, vm *sobek.Runtime) sobek.Value

Del removes key from the cache.

func (*Module) Get

func (c *Module) Get(call sobek.FunctionCall, vm *sobek.Runtime) sobek.Value

Get returns string.

func (*Module) GetBytes

func (c *Module) GetBytes(call sobek.FunctionCall, vm *sobek.Runtime) sobek.Value

GetBytes returns ArrayBuffer.

func (*Module) Instantiate

func (c *Module) Instantiate(rt *sobek.Runtime) (sobek.Value, error)

func (*Module) Set

func (c *Module) Set(call sobek.FunctionCall, vm *sobek.Runtime) sobek.Value

Set saves string to the cache with key.

func (*Module) SetBytes

func (c *Module) SetBytes(call sobek.FunctionCall, vm *sobek.Runtime) sobek.Value

SetBytes saves ArrayBuffer to the cache with key.

Jump to

Keyboard shortcuts

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