rediskit

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package rediskit helps to interact with redis storage backend

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromConfig

func NewFromConfig(cfg config.KVStore, path string) (*goredis.Client, error)

NewFromConfig returns redis *redis.Client instance from yaml config file

given config file contents:

	redis:
	  primary:
		username: <username>
		password: "<password>"
		host: mredis.aws.com
		port: 6379
		schema: 0
		conn:
		  max-idle: 20
		  max-lifetime: 10m
		  timeout: 5m
		  max-open: 100

then we can call using :

	v := viper.New()
	... set v file configs, etc

	db, err := log.NewFromConfig(v, "redis.primary")
	...continue using db.

func NewRedisConnection

func NewRedisConnection(option *db.Option) (*goredis.Client, error)

NewRedisConnection returns new redis client based on db Options.

Types

This section is empty.

Jump to

Keyboard shortcuts

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