MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / RPop

Method RPop

tx_list.go:50–57  ·  view source on GitHub ↗

RPop removes and returns the last element of the list stored in the bucket at given bucket and key.

(bucket string, key []byte)

Source from the content-addressed store, hash-verified

48
49// RPop removes and returns the last element of the list stored in the bucket at given bucket and key.
50func (tx *Tx) RPop(bucket string, key []byte) (item []byte, err error) {
51 item, err = tx.RPeek(bucket, key)
52 if err != nil {
53 return
54 }
55
56 return item, tx.push(bucket, key, DataRPopFlag, item)
57}
58
59// RPeek returns the last element of the list stored in the bucket at given bucket and key.
60func (tx *Tx) RPeek(bucket string, key []byte) ([]byte, error) {

Callers 3

buildListIdxMethod · 0.45
txPopFunction · 0.45
testRPopFunction · 0.45

Calls 2

RPeekMethod · 0.95
pushMethod · 0.95

Tested by 1

txPopFunction · 0.36