store

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 11 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"
)

Variables

This section is empty.

Functions

func Create

func Create(opts ...microstore.Option) microstore.Store

Create initializes a new store

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