memdb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore() kv.Service

NewStore returns a new memdb store instance.

func NewStoreWith added in v0.9.0

func NewStoreWith(coder document.KeyCoder) kv.Service

NewStoreWith returns a new memdb store instance with the specified key coder.

Types

type Database

type Database struct {
	*memdb.MemDB
	document.KeyCoder
}

Database represents a database.

func NewDatabaseWith added in v0.9.0

func NewDatabaseWith(coder document.KeyCoder) (*Database, error)

NewDatabaseWith returns a new database.

func (*Database) Transact

func (db *Database) Transact(write bool) (kv.Transaction, error)

Transact begin a new transaction.

type Document

type Document struct {
	Key   string
	Value []byte
}

Document represents a document.

type Store

type Store struct {
	*kv.BaseStore
	*Database
}

Store represents a Memdb store service instance.

func (*Store) ServiceName

func (store *Store) ServiceName() string

ServiceName returns the plug-ing service name.

func (*Store) Start

func (store *Store) Start() error

Start starts this memdb.

func (Store) Stop

func (store Store) Stop() error

Stop stops this memdb.

Jump to

Keyboard shortcuts

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