engine

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine - abstract data storage engine.

func New

func New(options ...Option) *Engine

New - creates a new instance of Engine.

func (*Engine) Del

func (e *Engine) Del(ctx context.Context, key string) error

Del - removes a key-value pair from memory.

func (*Engine) ForEachExpired

func (e *Engine) ForEachExpired(action func(key string))

ForEachExpired - scans engine partitions for retrieve expired keys.

func (*Engine) Get

func (e *Engine) Get(ctx context.Context, key string) (string, bool)

Get - retrieves the value associated with a key.

func (*Engine) Set

func (e *Engine) Set(ctx context.Context, key, value string, ttl int64)

Set - set stores a key-value pair in memory.

func (*Engine) Watch

func (e *Engine) Watch(ctx context.Context, key string) pkgsync.FutureString

Watch - watches the key and returns the value if it has changed.

type Option

type Option func(*Engine)

Option - options for configuring Engine.

func WithPartitionNum

func WithPartitionNum(partnum int) Option

WithPartitionNum - configures Engine with a partition number.

Jump to

Keyboard shortcuts

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