(bucket string, key, value []byte)
| 245 | } |
| 246 | |
| 247 | func (tx *Tx) GetSet(bucket string, key, value []byte) (oldValue []byte, err error) { |
| 248 | return oldValue, tx.update(bucket, key, func(b []byte) ([]byte, error) { |
| 249 | oldValue = b |
| 250 | return value, nil |
| 251 | }, func(oldTTL uint32) (uint32, error) { |
| 252 | return oldTTL, nil |
| 253 | }) |
| 254 | } |
| 255 | |
| 256 | // Has returns true if the record exists. It checks without retrieving the |
| 257 | // value from disk making lookups significantly faster while keeping memory |