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

Method Get

lib/datastore/boltdb.go:197–212  ·  view source on GitHub ↗
(key []byte)

Source from the content-addressed store, hash-verified

195}
196
197func (ds *BoltDbStore) Get(key []byte) ([]byte, error) {
198 if len(key) == 0 {
199 return nil, _const.ErrKeyIsEmpty
200 }
201 tx, err := ds.conn.Begin(false) // Start a read-only transaction
202 if err != nil {
203 return nil, err
204 }
205 defer check(tx.Rollback)
206 bucket := tx.Bucket(bucketStable)
207 val := bucket.Get(key)
208 if val == nil {
209 return nil, _const.ErrKeyNotFound
210 }
211 return val, nil
212}
213
214func (ds *BoltDbStore) SetUint64(key []byte, val uint64) error {
215 if len(key) == 0 {

Callers

nothing calls this directly

Calls 2

checkFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected