Пример #1
0
func RedisDeleteTeam(tid uint64) error {
	userKey := fmt.Sprintf("%s%d", KEY_TEAM_INFO, tid)
	redis.RedisDel(userKey)

	userKey = fmt.Sprintf("%s%d", SET_TEAM_MEMBER, tid)

	uidList, err := redis.SMembers(userKey).Result()

	if err != nil {
		return errors.As(err, tid)
	} else {
		for _, val := range uidList {
			userKey2 := fmt.Sprintf("%s%s", SET_USERS_TEAM, val)
			val := fmt.Sprintf("%d", tid)
			redis.SRem(userKey2, val)
		}
	}

	redis.RedisDel(userKey)

	return nil
}
Пример #2
0
func RedisDelMsgBuf(msgId uint64, msg []byte) error {
	userKey := fmt.Sprintf("%s%d", KEY_TEAMMSGBUF, msgId)
	redis.RedisDel(userKey)
	return nil
}