Files
go-redis/csc_extractkeys_test.go
ofekshenawa 856a2f0acd feat(csc): derive command eligibility (#3960)
* feat(csc): metadata-driven command eligibility

* fix linting issues

* feat(csc): add dynamic metadata resolver

* fix incompatibillity issues

* fix issues

* fix issues

* fix issues

* feat(csc): share dynamic command metadata

* correct cluster metadata and routing

* Reuse identicle records without building it from scratch again

* Address comments

* Address comments

* Address comments

* Address ci failures

* harden metadata and cluster routing

* verify metadata and list all nodes

* fix hello callback

* Perf improvements

* fix bless scan routing methods

* refactor(csc): separate cluster routing

* Add server identification in HELLO && Split csc checks in autopipline
2026-10-20 16:33:57 +03:00

22 lines
693 B
Go

package redis
// extractRedisKeys applies the default metadata view to a command and returns
// every Redis key whose invalidation must evict its cached reply. Production
// code validates the layout first and renders namespaced keys only on a miss.
func extractRedisKeys(cmd Cmder) []string {
return extractRedisKeysInView(defaultCommandMetadataView(), cmd)
}
// cscCollectKeys returns nil — never a partial list — if any key fails keyArg.
func cscCollectKeys(cmd Cmder, first, step, n int) []string {
keys := make([]string, 0, n)
for i, k := first, 0; k < n; i, k = i+step, k+1 {
key, ok := keyArg(cmd, i)
if !ok {
return nil
}
keys = append(keys, key)
}
return keys
}