store

package
v0.0.0-...-cf015e3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, log *slog.Logger, cfg *Config) (gokvstores.KVStore, error)

New returns a KVStore from config

Types

type CacheConfig

type CacheConfig struct {
	CleanupInterval int `mapstructure:"cleanup_interval"`
	Expiration      int
}

type Config

type Config struct {
	Cache           CacheConfig `mapstructure:"cache"`
	Prefix          string
	Redis           RedisConfig           `mapstructure:"redis"`
	RedisCluster    RedisClusterConfig    `mapstructure:"redis-cluster"`
	RedisRoundRobin RedisRoundRobinConfig `mapstructure:"redis-roundrobin"`
	Type            string
}

Config is a struct to represent a key/value store (redis, cache)

type RedisClusterConfig

type RedisClusterConfig struct {
	Addrs      []string
	Expiration int
	Password   string
}

type RedisConfig

type RedisConfig struct {
	DB         int
	Expiration int
	Host       string
	Password   string
	Port       int
}

func (RedisConfig) Addr

func (r RedisConfig) Addr() string

type RedisRoundRobinConfig

type RedisRoundRobinConfig struct {
	Addrs      []string
	Expiration int
	Password   string
}

type Store

type Store gokvstores.KVStore

Jump to

Keyboard shortcuts

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