예제 #1
0
파일: mem.go 프로젝트: rfistman/camlistore
// 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}
}