(key []byte, val []byte)
| 117 | } |
| 118 | |
| 119 | func (rds *RocksDbStore) Set(key []byte, val []byte) error { |
| 120 | if len(key) == 0 { |
| 121 | return _const.ErrKeyIsEmpty |
| 122 | } |
| 123 | wo := gorocksdb.NewDefaultWriteOptions() |
| 124 | wo.SetSync(true) |
| 125 | defer wo.Destroy() |
| 126 | err := rds.conn.Put(wo, key, val) |
| 127 | if err != nil { |
| 128 | return err |
| 129 | } |
| 130 | return nil |
| 131 | } |
| 132 | |
| 133 | func (rds *RocksDbStore) Get(key []byte) ([]byte, error) { |
| 134 | if len(key) == 0 { |