示例#1
0
// NewMemoryKeyValue returns a KeyValue implementation that's backed only
// by memory. It's mostly useful for tests and development.
func NewMemoryKeyValue() KeyValue {
	db := memdb.New(nil)
	return &memKeys{db: db}
}
示例#2
0
// NewMemoryIndex returns an Index backed only by memory, for use in tests.
func NewMemoryIndex() *Index {
	db := memdb.New(nil)
	memStorage := &memKeys{db: db}
	return New(memStorage)
}
示例#3
0
// NewMemoryStorage returns an index Storage implementation that's backed only
// by memory, for use in tests.
func NewMemoryStorage() Storage {
	db := memdb.New(nil)
	return &memKeys{db: db}
}