示例#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):])
}
示例#2
0
func (s subspace) Contains(k fdb.KeyConvertible) bool {
	return bytes.HasPrefix(k.FDBKey(), s.b)
}