Beispiel #1
0
func (r *Redis) RegisterIdent(uuid string) error {
	conn := r.getConn()
	defer conn.Close()

	_, err := conn.Do("HSET", proto.HealthIdent(), uuid, "true")
	return err
}
Beispiel #2
0
func (r *Redis) UnregisterIdent(uuid string) error {
	conn := r.getConn()
	defer conn.Close()

	_, err := conn.Do("HDEL", proto.HealthIdent(), uuid)
	return err
}
Beispiel #3
0
func (r *Redis) ActiveIdents() (map[string]string, error) {
	conn := r.getConn()
	defer conn.Close()

	return redis.StringMap(conn.Do("HGETALL", proto.HealthIdent()))
}