Documentation ¶
Index ¶
Constants ¶
const ( // TypeMemory represents memory stores TypeMemory = "memory" // TypeNoop represents noop stores TypeNoop = "noop" // TypeEtcd represents etcd stores TypeEtcd = "etcd" // TypeRedis represents redis stores TypeRedis = "redis" // TypeRedisSentinel represents redis-sentinel stores TypeRedisSentinel = "redis-sentinel" // TypeOCMem represents ocmem stores TypeOCMem = "ocmem" // TypeNatsJS represents nats-js stores TypeNatsJS = "nats-js" // TypeNatsJSKV represents nats-js-kv stores TypeNatsJSKV = "nats-js-kv" )
Variables ¶
This section is empty.
Functions ¶
func Authentication ¶ added in v2.18.0
Authentication configures the username and password to use for authentication. Only supported by the `natsjskv` implementation.
func Create ¶
func Create(opts ...microstore.Option) microstore.Store
Create initializes a new store
func DisablePersistence ¶ added in v2.18.0
DisablePersistence disables the persistence of the store by instructing it to use memory only. Only supported by the `natsjs` and `natsjskv` implementations.
func Size ¶
Size configures the maximum capacity of the cache for the "ocmem" implementation, in number of items that the cache can hold per table. You can use 5000 to make the cache hold up to 5000 elements. The parameter only affects to the "ocmem" implementation, the rest will ignore it. If an invalid value is used, the default of 512 will be used instead.
func Store ¶
Store determines the implementation:
- "memory", for a in-memory implementation, which is also the default if noone matches
- "noop", for a noop store (it does nothing)
- "etcd", for etcd
- "nats-js" for nats-js, needs to have TTL configured at creation
- "redis", for redis
- "redis-sentinel", for redis-sentinel
- "ocmem", custom in-memory implementation, with fixed size and optimized prefix and suffix search
Types ¶
This section is empty.