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

25
pkg/redis/set.go Normal file
View File

@@ -0,0 +1,25 @@
package redis
// Set represents a set object using a map of empty structs
type Set map[string]void
type void struct{}
var member void
// Add id to the set, returns false if id exists
func (s Set) Add(id string) bool {
if _, ok := s[id]; ok {
return false
}
s[id] = member
return true
}
// Remove id from the set, return false if id doesn't exist
func (s Set) Remove(id string) bool {
if _, ok := s[id]; !ok {
return false
}
delete(s, id)
return true
}