mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	add other session providers (#5963)
This commit is contained in:
		
							
								
								
									
										27
									
								
								vendor/github.com/lunny/nodb/store/goleveldb/batch.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/lunny/nodb/store/goleveldb/batch.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| package goleveldb | ||||
|  | ||||
| import ( | ||||
| 	"github.com/syndtr/goleveldb/leveldb" | ||||
| ) | ||||
|  | ||||
| type WriteBatch struct { | ||||
| 	db     *DB | ||||
| 	wbatch *leveldb.Batch | ||||
| } | ||||
|  | ||||
| func (w *WriteBatch) Put(key, value []byte) { | ||||
| 	w.wbatch.Put(key, value) | ||||
| } | ||||
|  | ||||
| func (w *WriteBatch) Delete(key []byte) { | ||||
| 	w.wbatch.Delete(key) | ||||
| } | ||||
|  | ||||
| func (w *WriteBatch) Commit() error { | ||||
| 	return w.db.db.Write(w.wbatch, nil) | ||||
| } | ||||
|  | ||||
| func (w *WriteBatch) Rollback() error { | ||||
| 	w.wbatch.Reset() | ||||
| 	return nil | ||||
| } | ||||
		Reference in New Issue
	
	Block a user