Example #1
0
func (s subspace) Unpack(k fdb.KeyConvertible) (tuple.Tuple, error) {
	key := k.FDBKey()
	if !bytes.HasPrefix(key, s.b) {
		return nil, errors.New("key is not in subspace")
	}
	return tuple.Unpack(key[len(s.b):])
}
Example #2
0
func (s subspace) Contains(k fdb.KeyConvertible) bool {
	return bytes.HasPrefix(k.FDBKey(), s.b)
}