| 1234567891011121314151617181920212223242526 |
- package core
- type OrCondition struct {
- Conditions []Condition
- }
- func Or(conditions ...Condition) Condition {
- return OrCondition{Conditions: conditions}
- }
- func (c OrCondition) Fields() []string {
- var fields []string
- for _, cond := range c.Conditions {
- fields = append(fields, cond.Fields()...)
- }
- return fields
- }
- func (c OrCondition) Match(row []byte, table *Table) bool {
- for _, cond := range c.Conditions {
- if cond.Match(row, table) {
- return true
- }
- }
- return false
- }
|