/
filter.go
26 lines (21 loc) · 963 Bytes
/
filter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2016 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package filter contains filter implementations for matching collections and
// rows within them.
package filter
import (
wire "v.io/v23/services/syncbase"
)
const pkgPath = "v.io/x/ref/services/syncbase/server/filter"
// CollectionRowFilter specifies a filter on collections and rows within them.
type CollectionRowFilter interface {
// CollectionMatches should return true iff the specified collection matches
// the filter.
CollectionMatches(cxId wire.Id) bool
// RowMatches should return true iff the specified row in the specified
// collection matches the filter. It must return false if CollectionMatches
// returns false for the specified collection.
// TODO(ivanpi): Match might require passing in value, e.g. for query filters.
RowMatches(cxId wire.Id, key string) bool
}