Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gin-gonic/gin v1.10.1
github.com/google/uuid v1.3.0
github.com/splitio/gincache v1.0.1
github.com/splitio/go-split-commons/v8 v8.0.0-20251029203719-4fdb9d7a1ff2
github.com/splitio/go-split-commons/v8 v8.0.0-20251030180738-32b17c825b5e
github.com/splitio/go-toolkit/v5 v5.4.1
github.com/stretchr/testify v1.11.1
go.etcd.io/bbolt v1.3.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUA
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/splitio/gincache v1.0.1 h1:dLYdANY/BqH4KcUMCe/LluLyV5WtuE/LEdQWRE06IXU=
github.com/splitio/gincache v1.0.1/go.mod h1:CcgJDSM9Af75kyBH0724v55URVwMBuSj5x1eCWIOECY=
github.com/splitio/go-split-commons/v8 v8.0.0-20251029203719-4fdb9d7a1ff2 h1:M2+G0qWJhi5UC4yfQ8MePtDMmfCPlMXbL7+oJPKjGL8=
github.com/splitio/go-split-commons/v8 v8.0.0-20251029203719-4fdb9d7a1ff2/go.mod h1:vgRGPn0s4RC9/zp1nIn4KeeIEj/K3iXE2fxYQbCk/WI=
github.com/splitio/go-split-commons/v8 v8.0.0-20251030180738-32b17c825b5e h1:GUKXzfgM7mpBpWNOlpI63+yBzt4oXY/fEC0CWkD7f78=
github.com/splitio/go-split-commons/v8 v8.0.0-20251030180738-32b17c825b5e/go.mod h1:vgRGPn0s4RC9/zp1nIn4KeeIEj/K3iXE2fxYQbCk/WI=
github.com/splitio/go-toolkit/v5 v5.4.1 h1:srTyvDBJZMUcJ/KiiQDMyjCuELVgTBh2TGRVn0sOXEE=
github.com/splitio/go-toolkit/v5 v5.4.1/go.mod h1:SifzysrOVDbzMcOE8zjX02+FG5az4FrR3Us/i5SeStw=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
8 changes: 0 additions & 8 deletions splitio/proxy/controllers/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,11 @@ func (c *SdkServerController) SplitChanges(ctx *gin.Context) {
rules.FeatureFlags.Splits = c.patchUnsupportedMatchers(rules.FeatureFlags.Splits, spec)

if spec == specs.FLAG_V1_3 {
fmt.Println("1.3 1.3 1.3 1.3 1.3 ")
fmt.Println("cantidad de ff:", len(rules.FeatureFlags.Splits), rules.FeatureFlags.Since, rules.FeatureFlags.Till)
fmt.Println("cantidad de rb:", len(rules.RuleBasedSegments.RuleBasedSegments), rules.RuleBasedSegments.Since, rules.RuleBasedSegments.Till)
ctx.JSON(http.StatusOK, rules)
ctx.Set(caching.SurrogateContextKey, []string{caching.SplitSurrogate})
ctx.Set(caching.StickyContextKey, true)
return
}
fmt.Println("otra otra otra otra")
ctx.JSON(http.StatusOK, dtos.SplitChangesDTO{
Splits: rules.FeatureFlags.Splits,
Since: rules.FeatureFlags.Since,
Expand Down Expand Up @@ -210,12 +206,8 @@ func (c *SdkServerController) MySegments(ctx *gin.Context) {
}

func (c *SdkServerController) fetchRulesSince(since int64, rbsince int64, sets []string) (*dtos.RuleChangesDTO, error) {
fmt.Println("split change since: ", since)
splits, err := c.proxySplitStorage.ChangesSince(since, sets)
fmt.Println("split result: ", splits, err)
fmt.Println("rule baseed since: ", rbsince)
rbs, rbsErr := c.proxyRBSegmentStorage.ChangesSince(rbsince)
fmt.Println("rulebased result: ", rbs, rbsErr)
if err == nil && rbsErr == nil {
return &dtos.RuleChangesDTO{
FeatureFlags: dtos.FeatureFlagsDTO{
Expand Down
5 changes: 5 additions & 0 deletions splitio/proxy/storage/rulebasedsegments.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,10 @@ func (p *ProxyRuleBasedSegmentsStorageImpl) setStartingPoint(cn int64) {
p.mtx.Unlock()
}

// FetchMany fetches rule-based segments in the storage and returns an array of rule-based segments dtos
func (p *ProxyRuleBasedSegmentsStorageImpl) FetchMany(rbsNames []string) map[string]*dtos.RuleBasedSegmentDTO {
return p.snapshot.FetchMany(rbsNames)
}

var _ ProxyRuleBasedSegmentsStorage = (*ProxyRuleBasedSegmentsStorageImpl)(nil)
var _ storage.RuleBasedSegmentsStorage = (*ProxyRuleBasedSegmentsStorageImpl)(nil)
Loading