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