Last active
July 25, 2017 05:32
-
-
Save rogeruiz/6bbfaa1424aab58726bab0f4d2151811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/go-redis/redis" | |
) | |
func main() { | |
fmt.Print("Hello, Roger") | |
client := redis.NewClient(&redis.Options{ | |
// Address received by minikube service -n default redis-sentinel-proxy | |
Addr: "192.168.99.100:31646", | |
// Password generated by k8s-redis-ha using namespace, port, and name | |
Password: "_redis-server._tcp.redis-server.default.svc.cluster.local", | |
DB: 0, | |
}) | |
err := client.Set("yolo", "true", 0).Err() | |
if err != nil { | |
fmt.Println("") | |
panic(err) | |
} | |
val, err := client.Get("yolo").Result() | |
if err != nil { | |
fmt.Println("") | |
panic(err) | |
} | |
fmt.Println("yolo", val) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment