stores

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

MemoryStore - In-app memory storage

func NewMemoryStore

func NewMemoryStore() *MemoryStore

NewMemoryStore - Create new MemoryStore

func (*MemoryStore) DataKey

DataKey - Generate DataKey with events and destination

func (*MemoryStore) Enqueue

func (ms *MemoryStore) Enqueue(_ context.Context, key string, value string, ttl time.Duration) (bool, error)

Enqueue - ttl: optional params for setting the ttl of queue when first element is enqueued

func (*MemoryStore) Get

Get - Get value from store, return with remaining time

func (*MemoryStore) GetQueue

func (ms *MemoryStore) GetQueue(_ context.Context, key string) ([]string, bool, time.Duration, error)

func (*MemoryStore) Len

func (ms *MemoryStore) Len() int

Len - Get memory size

func (*MemoryStore) Remove

func (ms *MemoryStore) Remove(_ context.Context, key string) (bool, error)

Remove - Remove value in store

func (*MemoryStore) Set

func (ms *MemoryStore) Set(_ context.Context, key string, value string, ttl time.Duration) (bool, error)

Set - Set value into store with ttl

func (*MemoryStore) Update

func (ms *MemoryStore) Update(_ context.Context, key string, value string) (bool, error)

Update - Update value into store

Jump to

Keyboard shortcuts

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