inmemory

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DefaultExpiration int32
	CleanupInterval   int32
}

Config is the configuration for the in-memory cache

type InMemoryCache

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

InMemoryCache holds the handler for the in-memory cache using go-cache

func NewCache

func NewCache(config *Config) (*InMemoryCache, error)

InMemoryCacheConfig is the configuration for the in-memory cache

func (*InMemoryCache) Delete

func (imc *InMemoryCache) Delete(ctx context.Context, key string) error

Delete implements Cache.

func (*InMemoryCache) Flush

func (imc *InMemoryCache) Flush(ctx context.Context)

Flushes out all the keys from Cache.

func (*InMemoryCache) Get

func (imc *InMemoryCache) Get(ctx context.Context, key string) (interface{}, error)

Get implements Cache.

func (*InMemoryCache) Set

func (imc *InMemoryCache) Set(
	ctx context.Context,
	key string,
	value string,
	ttl time.Duration,
) error

Set implements inmemory

Jump to

Keyboard shortcuts

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