kv

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IKV

type IKV interface {
	Store(ctx context.Context, key string, field string, attrs string) error
	Load(ctx context.Context, key string) (map[string]string, error)
	Delete(ctx context.Context, key string, fields ...string) error
}

IKV interface

func New

func New(ctx context.Context, config broker.Config) (IKV, error)

New KV

func NewNats

func NewNats(ctx context.Context, conn *natsclient.Client) (IKV, error)

NewNats returns NATS kv client

func NewRedis

func NewRedis(client *redispkg.Client) IKV

NewRedis returns redis kv client

type Nats

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

Nats ...

func (*Nats) Delete

func (n *Nats) Delete(ctx context.Context, key string, fields ...string) error

Delete values for a key

func (*Nats) Load

func (n *Nats) Load(ctx context.Context, key string) (map[string]string, error)

Load values for a key

func (*Nats) Store

func (n *Nats) Store(ctx context.Context, key string, field string, attrs string) error

Store key with values

type Redis

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

Redis ...

func (*Redis) Delete

func (r *Redis) Delete(ctx context.Context, key string, fields ...string) error

Delete values for a key

func (*Redis) Load

func (r *Redis) Load(ctx context.Context, key string) (map[string]string, error)

Load values for a key

func (*Redis) Store

func (r *Redis) Store(ctx context.Context, key string, field string, attrs string) error

Store key with values

Jump to

Keyboard shortcuts

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