github.com/linapex/ethereum-go-chinese@v0.0.0-20190316121929-f8b7a73c3fa1/ethdb/database_js.go (about) 1 2 //<developer> 3 // <name>linapex 曹一峰</name> 4 // <email>linapex@163.com</email> 5 // <wx>superexc</wx> 6 // <qqgroup>128148617</qqgroup> 7 // <url>https://jsq.ink</url> 8 // <role>pku engineer</role> 9 // <date>2019-03-16 19:16:38</date> 10 //</624450090370600960> 11 12 13 //+构建JS 14 15 package ethdb 16 17 import ( 18 "errors" 19 ) 20 21 var errNotSupported = errors.New("ethdb: not supported") 22 23 type LDBDatabase struct { 24 } 25 26 //NewLdbDatabase返回一个LevelDB包装的对象。 27 func NewLDBDatabase(file string, cache int, handles int) (*LDBDatabase, error) { 28 return nil, errNotSupported 29 } 30 31 //path返回数据库目录的路径。 32 func (db *LDBDatabase) Path() string { 33 return "" 34 } 35 36 //Put将给定的键/值放入队列 37 func (db *LDBDatabase) Put(key []byte, value []byte) error { 38 return errNotSupported 39 } 40 41 func (db *LDBDatabase) Has(key []byte) (bool, error) { 42 return false, errNotSupported 43 } 44 45 //get返回给定的键(如果存在)。 46 func (db *LDBDatabase) Get(key []byte) ([]byte, error) { 47 return nil, errNotSupported 48 } 49 50 //删除从队列和数据库中删除键 51 func (db *LDBDatabase) Delete(key []byte) error { 52 return errNotSupported 53 } 54 55 func (db *LDBDatabase) Close() { 56 } 57 58 //Meter配置数据库度量收集器和 59 func (db *LDBDatabase) Meter(prefix string) { 60 } 61 62 func (db *LDBDatabase) NewBatch() Batch { 63 return nil 64 } 65