Documentation ¶
Index ¶
Constants ¶
const DefaultMaxdepth = 1<<31 - 1
DefaultMaxdepth is the default value of the maxdepth option. It is set to the max value of a 32-bit integer.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASTNode ¶
type ASTNode interface { Marshal() interface{} Unmarshal(interface{}) error }
ASTNode represents an AST node in the RQL. Marshal should return an interface{} value that works with ast.MarshalJSON. This would typically be either a map[string]interface{} (JSON object), an []interface{} (JSON array), or a primitive type like nil (null), float64 (number), string, boolean, and time.Time. Similarly, the input in Unmarshal is an interface{} value that was decoded by ast.UnmarshalJSON.
type ActionPredicate ¶
ActionPredicate represents a predicate on a Wash action.
type Entry ¶
type Entry struct { apitypes.Entry Schema *EntrySchema // contains filtered or unexported fields }
Entry represents an RQL entry
func Find ¶
Find returns all descendants of the start entry that satisfy the given query Note that all returned entries' paths will start from "", which represents the start path. For example, if "childOne" and "childTwo" are the cnames of the start entry's children, then their "Path" fields will be set to "childOne" and "childTwo" (where the start entry's path of "" is automatically prefixed).
Each entry's children are descended in lexicographic order (based on their cnames). So given entries "foo", "foo/bar", "foo/baz", "foo/baz/1", the returned entries will be ["foo", "foo/bar", "foo/baz", "foo/baz/1"] (because "bar" comes before "baz").
func (Entry) SchemaKnown ¶
type EntryPredicate ¶
EntryPredicate represents a predicate on an entry
type EntrySchema ¶
type EntrySchema = apitypes.EntrySchema
EntrySchema represents an RQL entry's schema
type EntrySchemaPredicate ¶
type EntrySchemaPredicate interface {
EvalEntrySchema(*EntrySchema) bool
}
EntrySchemaPredicate represents a predicate on an entry schema object
type NumericPredicate ¶
NumericPredicate represents a predicate on a numeric value. The decimal.Decimal type lets us handle arbitrarily large numbers.
type Options ¶
type Options struct { // Mindepth is the minimum depth. Descendants at lesser depths are not included // in the RQL's returned list of entries. // // Depth starts from 0. For example, given paths "foo", "foo/bar", "foo/bar/baz", // assume "foo" is the start path. Then "foo" is at depth 0, "foo/bar" is at depth 1, // "foo/bar/baz" is at depth 2, etc. Mindepth int // Maxdepth is the maximum depth. Descendants at greater depths are not included // in the RQL's returned list of entries. See Mindepth's comments to understand how // depth is calculated. Maxdepth int // Fullmeta is short for "full metadata". If set, then meta primary queries act on // the entry's full metadata, and the returned list of entries will include the entry's // full metadata. If unset then the RQL uses the partial metadata instead. // // Note that setting Fullmeta could result in O(N) extra requests to fetch the metadata, // where N is the number of visited entries. Using the partial metadata (unsetting Fullmeta) // does not result in any extra request. Fullmeta bool }
Options represent the RQL's options
type Query ¶
type Query interface { ASTNode EntryPredicate EntrySchemaPredicate }
Query represents an RQL query
type StringPredicate ¶
StringPredicate represents a predicate on a string value
type TimePredicate ¶
TimePredicate represents a predicate on a time value.
type ValuePredicate ¶
type ValuePredicate interface { ASTNode EvalValue(interface{}) bool EvalValueSchema(*plugin.JSONSchema) bool }
ValuePredicate represents a predicate on a metadata (JSON) value