rediskey.go 610 B

12345678910111213141516171819202122232425262728
  1. package service
  2. import "fmt"
  3. const (
  4. _recPoolTtl = 60
  5. _recPoolKey = "rec_pool_%d"
  6. _recInfoExpireTtl = 86400
  7. _recInfoKey = "rec_info_%d"
  8. _recConfExpireTtl = 86400
  9. _recConfKey = "rec_conf"
  10. )
  11. func (s *Service) getRecPoolKey(id int) (key string, expire int) {
  12. key = fmt.Sprintf(_recPoolKey, id)
  13. expire = _recPoolTtl
  14. return
  15. }
  16. func (s *Service) getRecInfoKey(roomId int) (key string, expire int) {
  17. key = fmt.Sprintf(_recInfoKey, roomId)
  18. expire = _recInfoExpireTtl
  19. return
  20. }
  21. func (s *Service) getRecConfKey() (key string, expire int) {
  22. return _recConfKey, _recConfExpireTtl
  23. }