inmemory

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0, NCSA Imports: 11 Imported by: 1

Documentation

Overview

Package inmemory provides a in-memory implementation of graphstore.Service and keyvalue.DB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphStore added in v0.0.25

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

GraphStore implements the graphstore.Service interface. A zero of this type is ready for use, and is safe for access by concurrent goroutines.

func (*GraphStore) Close added in v0.0.25

func (*GraphStore) Close(ctx context.Context) error

Close implements io.Closer. It never returns an error.

func (*GraphStore) Read added in v0.0.25

Read implements part of the graphstore.Service interface.

func (*GraphStore) Scan added in v0.0.25

Scan implements part of the graphstore.Service interface.

func (*GraphStore) Write added in v0.0.25

func (s *GraphStore) Write(ctx context.Context, req *spb.WriteRequest) error

Write implements part of the graphstore.Service interface.

type KeyValueDB added in v0.0.29

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

KeyValueDB implements the keyvalue.DB interface backed by an in-memory map.

func NewKeyValueDB added in v0.0.29

func NewKeyValueDB() *KeyValueDB

NewKeyValueDB returns a keyvalue.DB backed by an in-memory data structure.

func (*KeyValueDB) Close added in v0.0.29

func (k *KeyValueDB) Close(context.Context) error

Close implements part of the keyvalue.DB interface.

func (*KeyValueDB) Get added in v0.0.29

func (k *KeyValueDB) Get(ctx context.Context, key []byte, opts *keyvalue.Options) ([]byte, error)

Get implements part of the keyvalue.DB interface.

func (*KeyValueDB) NewSnapshot added in v0.0.29

func (k *KeyValueDB) NewSnapshot(ctx context.Context) keyvalue.Snapshot

NewSnapshot implements part of the keyvalue.DB interface.

func (*KeyValueDB) ScanPrefix added in v0.0.29

func (k *KeyValueDB) ScanPrefix(ctx context.Context, prefix []byte, opts *keyvalue.Options) (keyvalue.Iterator, error)

ScanPrefix implements part of the keyvalue.DB interface.

func (*KeyValueDB) ScanRange added in v0.0.29

func (k *KeyValueDB) ScanRange(ctx context.Context, r *keyvalue.Range, opts *keyvalue.Options) (keyvalue.Iterator, error)

ScanRange implements part of the keyvalue.DB interface.

func (*KeyValueDB) Writer added in v0.0.29

func (k *KeyValueDB) Writer(ctx context.Context) (keyvalue.Writer, error)

Writer implements part of the keyvalue.DB interface.

Jump to

Keyboard shortcuts

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