20 lines
333 B
Go
20 lines
333 B
Go
|
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, ":"))
|
||
|
}
|