예제 #1
0
파일: db.go 프로젝트: Eddie0330/ledisdb
func (db *DB) NewWriteBatch() *WriteBatch {
	wb := &WriteBatch{
		db:     db,
		wbatch: C.leveldb_writebatch_create(),
	}
	return wb
}
예제 #2
0
파일: batch.go 프로젝트: malloc-fi/vantaa
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
파일: db.go 프로젝트: huanshi/ledisdb
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}
}