Example #1
0
func SetUserState(us *UserState) error {
	key := fmt.Sprintf("user_state_%v", us.Uid)
	body, err := json.Marshal(us)
	if err != nil {
		return errors.As(err, *us)
	}
	if err := redis_.Set(key, string(body)); err != nil {
		return errors.As(err, string(body))
	}
	return nil
}
Example #2
0
func SetUserToken(uid uint64, token string) error {
	return redis.Set(fmt.Sprint(USER_TOKEN, uid), token)
}
Example #3
0
func SetUserSetupId(uid uint64, setupId string) error {
	return redis.Set(fmt.Sprint(USER_TOKEN, uid), setupId)
}