memory

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package memory provides a memory storage implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

Config represents the configuration used to create a memory backed storage.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig provides a default configuration to create a new memory backed storage by best effort.

type Storage

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

Storage is the memory backed storage.

func New

func New(config Config) (*Storage, error)

New creates a new configured memory storage.

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, k microstorage.K) error

func (*Storage) Exists

func (s *Storage) Exists(ctx context.Context, k microstorage.K) (bool, error)

func (*Storage) List

func (s *Storage) List(ctx context.Context, k microstorage.K) ([]microstorage.KV, error)

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, kv microstorage.KV) error

func (*Storage) Search

func (s *Storage) Search(ctx context.Context, k microstorage.K) (microstorage.KV, error)

Jump to

Keyboard shortcuts

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