Documentation ¶
Index ¶
- Constants
- type Condition
- type Query
- func (q *Query) Check() (*Query, error)
- func (q *Query) DatabaseKeyPrefix() string
- func (q *Query) DatabaseName() string
- func (q *Query) IsChecked() bool
- func (q *Query) Limit(limit int) *Query
- func (q *Query) Matches(r record.Record) bool
- func (q *Query) MatchesAccessor(acc accessor.Accessor) bool
- func (q *Query) MatchesKey(dbKey string) bool
- func (q *Query) MatchesRecord(r record.Record) bool
- func (q *Query) MustBeValid() *Query
- func (q *Query) Offset(offset int) *Query
- func (q *Query) OrderBy(key string) *Query
- func (q *Query) Print() string
- func (q *Query) Where(condition Condition) *Query
Constants ¶
const ( Equals uint8 = iota // int GreaterThan // int GreaterThanOrEqual // int LessThan // int LessThanOrEqual // int FloatEquals // float FloatGreaterThan // float FloatGreaterThanOrEqual // float FloatLessThan // float FloatLessThanOrEqual // float SameAs // string Contains // string StartsWith // string EndsWith // string In // stringSlice Matches // regex Is // bool: accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE Exists // any )
Operators
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition interface {
// contains filtered or unexported methods
}
Condition is an interface to provide a common api to all condition types.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query contains a compiled query.
func ParseQuery ¶
ParseQuery parses a plaintext query. Special characters (that must be escaped with a '\') are: `\()` and any whitespaces.
func (*Query) DatabaseKeyPrefix ¶
DatabaseKeyPrefix returns the key prefix for the database.
func (*Query) DatabaseName ¶
DatabaseName returns the name of the database.
func (*Query) MatchesAccessor ¶
MatchesAccessor checks whether the query matches the supplied accessor (value only).
func (*Query) MatchesKey ¶
MatchesKey checks whether the query matches the supplied database key (key without database prefix).
func (*Query) MatchesRecord ¶
MatchesRecord checks whether the query matches the supplied database record (value only).
func (*Query) MustBeValid ¶
MustBeValid checks for errors in the query and panics if there is an error.