Documentation ¶
Overview ¶
Package inmemory provides a in-memory implementation of graphstore.Service and keyvalue.DB.
Index ¶
- type GraphStore
- func (*GraphStore) Close(ctx context.Context) error
- func (s *GraphStore) Read(ctx context.Context, req *spb.ReadRequest, f graphstore.EntryFunc) error
- func (s *GraphStore) Scan(ctx context.Context, req *spb.ScanRequest, f graphstore.EntryFunc) error
- func (s *GraphStore) Write(ctx context.Context, req *spb.WriteRequest) error
- type KeyValueDB
- func (k *KeyValueDB) Close(context.Context) error
- func (k *KeyValueDB) Get(ctx context.Context, key []byte, opts *keyvalue.Options) ([]byte, error)
- func (k *KeyValueDB) NewSnapshot(ctx context.Context) keyvalue.Snapshot
- func (k *KeyValueDB) ScanPrefix(ctx context.Context, prefix []byte, opts *keyvalue.Options) (keyvalue.Iterator, error)
- func (k *KeyValueDB) ScanRange(ctx context.Context, r *keyvalue.Range, opts *keyvalue.Options) (keyvalue.Iterator, error)
- func (k *KeyValueDB) Writer(ctx context.Context) (keyvalue.Writer, error)
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
func (s *GraphStore) Read(ctx context.Context, req *spb.ReadRequest, f graphstore.EntryFunc) error
Read implements part of the graphstore.Service interface.
func (*GraphStore) Scan ¶ added in v0.0.25
func (s *GraphStore) Scan(ctx context.Context, req *spb.ScanRequest, f graphstore.EntryFunc) error
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) 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.