memory

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage is the memory implementation of a storage backend

func NewStorage

func NewStorage() *Storage

NewStorage creates a new memory storage

func (*Storage) DecrBy

func (s *Storage) DecrBy(key string, update int64) (err error)

DecrBy decreases the value saved at key by the amount provided through update It assumes the value saved for the key either does not exist or has a type of int64

func (*Storage) Del

func (s *Storage) Del(key string) (err error)

Del removes a saved value from a memory storage

func (*Storage) Get

func (s *Storage) Get(key string) (value interface{}, exists bool, err error)

Get retrieves a saved value from memory storage

func (*Storage) GetWithValue added in v0.18.0

func (s *Storage) GetWithValue(key string, ptr interface{}) (exists bool, err error)

func (*Storage) IncrBy

func (s *Storage) IncrBy(key string, update int64) (err error)

IncrBy increases the value saved at key by the amount provided through update It assumes the value saved for the key either does not exist or has a type of int64

func (*Storage) Put

func (s *Storage) Put(key string, value interface{}) (err error)

Put puts a value into the memory storage

Jump to

Keyboard shortcuts

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