Skip to content

Commit

Permalink
WIP: adding changes in condition
Browse files Browse the repository at this point in the history
  • Loading branch information
nmayorsplit committed May 10, 2024
1 parent 06e449b commit f3ccef6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions engine/grammar/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package grammar
import (
"github.com/splitio/go-split-commons/v5/dtos"
"github.com/splitio/go-split-commons/v5/engine/grammar/matchers"
"github.com/splitio/go-split-commons/v5/engine/grammar/matchers/datatypes"
"github.com/splitio/go-toolkit/v5/injection"
"github.com/splitio/go-toolkit/v5/logging"
)
Expand Down Expand Up @@ -39,6 +40,18 @@ func NewCondition(cond *dtos.ConditionDTO, ctx *injection.Context, logger loggin
}
}

func proccessMatchers(condMatchers []dtos.MatcherDTO, ctx *injection.Context, logger logging.LoggerInterface) []matchers.MatcherInterface {
matcherObjs := make([]matchers.MatcherInterface, 0)
for _, matcher := range condMatchers {
m, err := matchers.BuildMatcher(&matcher, ctx, logger)
if err == nil {
matcherObjs = append(matcherObjs, m)
} else if errType, ok := err.(datatypes.UnsupportedMatcherError); ok {

}
}
}

// Partition struct with added logic that wraps around a DTO
type Partition struct {
partitionData dtos.PartitionDTO
Expand Down

0 comments on commit f3ccef6

Please sign in to comment.