Documentation ¶
Overview ¶
Package conds contains supporting code for conditional bindings.
Used internally by authdb.Snapshot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a caching factory of Conditions.
func NewBuilder ¶
NewBuilder returns a new builder that uses the given "vocabulary" of elementary conditions when building composite (ANDed) conditions.
This is usually `conditions` field from the Realms proto message. These elementary conditions are referenced by their index in Condition(...) method.
func (*Builder) Condition ¶
Condition either constructs a new condition or returns an existing one.
`indexes` are indexes of elementary conditions in the array passed to NewBuilder. The returned condition is an AND of all these elementary conditions. `indexes` are assumed to be ordered already.
Returns nil if the condition would always evaluate to true (in particular if `indexes` is empty).
Returns an error if some index is out of bounds. This should not happen in a valid AuthDB.