Add redis setup & initialization, db.StoreCommand function

This commit is contained in:
2023-12-12 02:49:39 -06:00
parent ba1d02d146
commit fdb2a48cf7
4 changed files with 48 additions and 2 deletions

17
data.go Normal file
View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
)
func StoreCode(code string, location int64, member_id int) bool {
key := fmt.Sprintf("code:%d:%d", location, member_id)
val_exists := db.Exists(key).Val()
db.Set(key, code, 0)
val := db.Get(code).Val()
fmt.Println(val, val_exists)
return false
}