Documentation
¶
Index ¶
- Variables
- func ReSetDefaultOptions()
- func SetDefaultOptions(opts ...optparams.Option[Options])
- func WithEtcdStyle() optparams.Option[Options]
- func WithKeyDelimiter(delimiter string) optparams.Option[Options]
- func WithNamespaceDelimiter(delimiter string) optparams.Option[Options]
- func WithPrefix(prefix string) optparams.Option[Options]
- func WithRandomKeyGen(algo idgener.IDGENAlgorithm) optparams.Option[Options]
- func WithRedisStyle() optparams.Option[Options]
- type NameSpcae
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotHaveNamespace = errors.New("key not have namespace")
ErrKeyNotHaveNamespace key没有命名空间
View Source
var ErrNamespaceFormatNotMatch = errors.New("namespace format not match")
ErrNamespaceFormatNotMatch 命名空间格式不匹配
Functions ¶
func SetDefaultOptions ¶
SetDefaultOptions 设置默认命名空间配置 @params opts ...optparams.Option[Options] 设置项
func WithKeyDelimiter ¶
WithKeyDelimiter 设置键间的分割符
func WithNamespaceDelimiter ¶
WithNamespaceDelimiter 设置命名空间间的分割符
func WithRandomKeyGen ¶ added in v0.0.2
func WithRandomKeyGen(algo idgener.IDGENAlgorithm) optparams.Option[Options]
WithRandomKeyGen 指定随机生成key时使用的随机算法
func WithRedisStyle ¶
WithRedisStyle 设置redis风格的命名空间设置
Types ¶
type NameSpcae ¶
type NameSpcae []string
NameSpcae 带命名空间的键
func FromFullName ¶
FromFullName 从全名字符串中解析出命名空间和key @params fullname string 带解析全名 @params opts ...optparams.Option[Options] 设置项 @return NameSpcae 命名空间 @return string key @return error 解析错误
func (*NameSpcae) FullName ¶
FullName 在命名空间基础上创建一个key的全名 @params key string 用于标识的键 @params opts ...optparams.Option[Options] 设置项
Click to show internal directories.
Click to hide internal directories.