memory

package
v2.0.0-...-5d9845c Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package memory Is a slight copy of the memory storage, but far from the storage interface it can not only work with bytes but directly store any kind of data without having to encode it each time, which gives a huge speed advantage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() *Storage

func (*Storage) Delete

func (s *Storage) Delete(key string)

Delete key by key

func (*Storage) Get

func (s *Storage) Get(key string) interface{}

Get value by key

func (*Storage) Reset

func (s *Storage) Reset()

Reset all keys

func (*Storage) Set

func (s *Storage) Set(key string, val interface{}, ttl time.Duration)

Set key with value

Jump to

Keyboard shortcuts

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