Files
open-im-server/pkg/common/storage/cache/cachekey/online.go
T

21 lines
313 B
Go
Raw Normal View History

2024-07-16 10:46:21 +08:00
package cachekey
2024-09-12 10:38:17 +08:00
import (
"strings"
"time"
)
2024-07-16 10:46:21 +08:00
const (
OnlineKey = "ONLINE:"
OnlineChannel = "online_change"
OnlineExpire = time.Hour / 2
)
func GetOnlineKey(userID string) string {
return OnlineKey + userID
}
2024-09-12 10:38:17 +08:00
func GetOnlineKeyUserID(key string) string {
return strings.TrimPrefix(key, OnlineKey)
}