store

package
v2.19.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

func Authentication(username, password string) store.Option

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

func DisablePersistence(val bool) store.Option

DisablePersistence disables the persistence of the store by instructing it to use memory only. Only supported by the `natsjs` and `natsjskv` implementations.

func Size

func Size(val int) store.Option

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

func Store(val string) store.Option

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

func TTL

func TTL(val time.Duration) store.Option

TTL is the time to live for documents stored in the store

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL