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

Method Set

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

Source from the content-addressed store, hash-verified

117}
118
119func (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
133func (rds *RocksDbStore) Get(key []byte) ([]byte, error) {
134 if len(key) == 0 {

Callers

nothing calls this directly

Calls 1

PutMethod · 0.65

Tested by

no test coverage detected