Пример #1
0
func (db *DB) NewWriteBatch() *WriteBatch {
	wb := &WriteBatch{
		db:     db,
		wbatch: C.leveldb_writebatch_create(),
	}
	return wb
}
Пример #2
0
func newWriteBatch(db *DB) *WriteBatch {
	w := new(WriteBatch)
	w.db = db
	w.wbatch = C.leveldb_writebatch_create()
	w.gbatch = new(leveldb.Batch)

	return w
}
Пример #3
0
func (db *DB) NewWriteBatch() driver.IWriteBatch {
	wb := &WriteBatch{
		db:     db,
		wbatch: C.leveldb_writebatch_create(),
	}

	runtime.SetFinalizer(wb, func(w *WriteBatch) {
		w.Close()
	})
	return wb
}
Пример #4
0
func New_writebatch() *Writebatch {
	wb := C.leveldb_writebatch_create()
	return &Writebatch{wb}
}