pgsqlkv

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package pgsqlkv provides XMPP functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DSN string `fig:"dsn"`
}

Config contains PostgreSQL KV configuration parameters.

type KV

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

KV represents a PostgreSQL key-value store implementation.

func New

func New(cfg Config, logger kitlog.Logger) *KV

New returns a new PostgreSQL key-value store instance.

func (*KV) Del

func (k *KV) Del(ctx context.Context, key string) error

Del deletes a value associated to a given key.

func (*KV) Get

func (k *KV) Get(ctx context.Context, key string) ([]byte, error)

Get retrieves a value associated to a given key.

func (*KV) GetPrefix

func (k *KV) GetPrefix(ctx context.Context, prefix string) (map[string][]byte, error)

GetPrefix retrieves all values whose key matches prefix.

func (*KV) Put

func (k *KV) Put(ctx context.Context, key string, value string) error

Put stores a new value associated to a given key.

func (*KV) Start

func (k *KV) Start(_ context.Context) error

Start initializes the PostgreSQL key-value store.

func (*KV) Stop

func (k *KV) Stop(_ context.Context) error

Stop closes the PostgreSQL connection.

func (*KV) Watch

func (k *KV) Watch(ctx context.Context, prefix string, withPrevVal bool) <-chan kvtypes.WatchResp

Watch watches on a key or prefix.

Jump to

Keyboard shortcuts

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