MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / SetUint64

Method SetUint64

lib/datastore/rocksdb.go:150–162  ·  view source on GitHub ↗
(key []byte, val uint64)

Source from the content-addressed store, hash-verified

148}
149
150func (rds *RocksDbStore) SetUint64(key []byte, val uint64) error {
151 if len(key) == 0 {
152 return _const.ErrKeyIsEmpty
153 }
154 wo := gorocksdb.NewDefaultWriteOptions()
155 wo.SetSync(true)
156 defer wo.Destroy()
157 err := rds.conn.Put(wo, key, uint64ToBytes(val))
158 if err != nil {
159 return err
160 }
161 return nil
162}
163
164func (rds *RocksDbStore) GetUint64(key []byte) (uint64, error) {
165 if len(key) == 0 {

Callers

nothing calls this directly

Calls 2

uint64ToBytesFunction · 0.85
PutMethod · 0.65

Tested by

no test coverage detected