package domain import "strings" type RedisKey string func (key RedisKey) ToString() string { return "product:" + string(key) } func (key RedisKey) With(s ...string) RedisKey { parts := append([]string{string(key)}, s...) return RedisKey(strings.Join(parts, ":")) } const ( GetProductRedisKey RedisKey = "get" ) func GetProductRK(id string) string { return GetProductRedisKey.With(id).ToString() }