Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package redisutils
import (
re "fiskerinc.com/modules/redis"
"github.com/gomodule/redigo/redis"
"github.com/pkg/errors"
)
func CheckSet(conn re.Client, id string, keys interface{}) ([]bool, error) {
ckeys, ok := keys.([]string)
if !ok {
return nil, errors.New("keys is not []string")
}
results := make([]bool, len(ckeys))
batch := re.NewRedisBatchCommands()
for _, key := range ckeys {
batch.Add("SISMEMBER", id, key)
}
values, err := conn.ExecuteBatch(batch)
if err != nil {
return results, err
}
err = redis.ScanSlice(values.([]interface{}), &results)
if err != nil {
return results, errors.WithStack(err)
}
return results, nil
}