app-cloudep-portal-api-gateway/internal/domain/redis.go

20 lines
333 B
Go
Raw Normal View History

2024-08-26 06:36:58 +00:00
package domain
import "strings"
type RedisKey string
const (
GenerateVerifyCodeRedisKey RedisKey = "rf_code"
)
func (key RedisKey) ToString() string {
return "gateway:" + string(key)
}
func (key RedisKey) With(s ...string) RedisKey {
parts := append([]string{string(key)}, s...)
return RedisKey(strings.Join(parts, ":"))
}