mirror of
https://github.com/Xevion/r2park.git
synced 2025-12-10 20:08:09 -06:00
Add redis setup & initialization, db.StoreCommand function
This commit is contained in:
17
data.go
Normal file
17
data.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user