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 }
func SetUserToken(uid uint64, token string) error { return redis.Set(fmt.Sprint(USER_TOKEN, uid), token) }
func SetUserSetupId(uid uint64, setupId string) error { return redis.Set(fmt.Sprint(USER_TOKEN, uid), setupId) }