(key []byte, val uint64)
| 212 | } |
| 213 | |
| 214 | func (ds *BoltDbStore) SetUint64(key []byte, val uint64) error { |
| 215 | if len(key) == 0 { |
| 216 | return _const.ErrKeyIsEmpty |
| 217 | } |
| 218 | tx, err := ds.conn.Begin(true) // Start a read-write transaction |
| 219 | if err != nil { |
| 220 | return err |
| 221 | } |
| 222 | defer check(tx.Rollback) |
| 223 | bucket := tx.Bucket(bucketStable) |
| 224 | err = bucket.Put(key, uint64ToBytes(val)) |
| 225 | if err != nil { |
| 226 | return err |
| 227 | } |
| 228 | return tx.Commit() |
| 229 | } |
| 230 | |
| 231 | func (ds *BoltDbStore) GetUint64(key []byte) (uint64, error) { |
| 232 | if len(key) == 0 { |
nothing calls this directly
no test coverage detected