memory

package
v0.0.169 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "memory"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct{}

func (*Config) Validate

func (c *Config) Validate() error

type Memory

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

func New

func New(config *Config, log logrus.FieldLogger) (*Memory, error)

func (*Memory) Delete

func (m *Memory) Delete(ctx context.Context, key string) error

func (*Memory) Get

func (m *Memory) Get(ctx context.Context, key string) (*string, error)

func (*Memory) GetAndDelete

func (m *Memory) GetAndDelete(ctx context.Context, key string) (deletedValue *string, exists bool, err error)

func (*Memory) GetOrSet

func (m *Memory) GetOrSet(ctx context.Context, key, value string, ttl time.Duration) (storedValue *string, retrieved bool, err error)

func (*Memory) Set

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

func (*Memory) Start

func (m *Memory) Start(ctx context.Context) error

func (*Memory) Stop

func (m *Memory) Stop(ctx context.Context) error

func (*Memory) Type

func (m *Memory) Type() string

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) AddDelete

func (m *Metrics) AddDelete(count int, cacheType, status string)

func (*Metrics) AddGet

func (m *Metrics) AddGet(count int, cacheType, status string)

func (*Metrics) AddSet

func (m *Metrics) AddSet(count int, cacheType, status string)

Jump to

Keyboard shortcuts

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