memory

package module
v0.0.0-...-f2c4dee Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...MemoryOpts) (storage.Connection, error)

Types

type InMemory

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

func (*InMemory) Bucket

func (m *InMemory) Bucket(bucket ...string) *storage.Bucket

func (*InMemory) Close

func (m *InMemory) Close()

func (*InMemory) Delete

func (m *InMemory) Delete(k string) error

func (*InMemory) Encoding

func (m *InMemory) Encoding() encoding.Coder

func (*InMemory) Exists

func (m *InMemory) Exists(k string) bool

func (*InMemory) Get

func (m *InMemory) Get(k string, v any) error

func (*InMemory) Iter

func (m *InMemory) Iter(ctx context.Context, pfx string) types.Iterator[string, []byte]

func (*InMemory) Keys

func (m *InMemory) Keys(pfx string) ([]string, error)

func (*InMemory) Len

func (m *InMemory) Len(pfx string) (int, error)

func (*InMemory) PrintDebug

func (m *InMemory) PrintDebug(pfx string) error

func (*InMemory) Set

func (m *InMemory) Set(k string, v any, op ...storage.Option) error

func (*InMemory) Tx

func (m *InMemory) Tx(pfx string, fn func(tx storage.Transactioner) error) error

func (*InMemory) Values

func (m *InMemory) Values(pfx string) ([][]byte, error)

func (*InMemory) Watch

func (m *InMemory) Watch(ctx context.Context, pfx string) types.Watcher[string, []byte]

type MemoryOpts

type MemoryOpts func(*InMemory) error

func Logger

func Logger(lg storage.Logger) MemoryOpts

Jump to

Keyboard shortcuts

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