command
Version:
v0.3.4
Opens a new window with list of versions in this module.
Published: Aug 5, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
kvstore-shared 示例:让 counter/cooldown/idempotency 跨实例共享状态。
演示 pkg/kvstore:用 WithStore 把三个"有状态"原语的状态存到共享 Store,使其从
"单进程内存"升级为"多实例一致"。本例用内存 Store 模拟(单进程内两个实例共享
同一 Store);生产替换成 Redis 实现的 kvstore.Store 即可(见文件末尾的映射说明)。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.