tinyredis

package
v1.0.45 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package tinyredis provides utilities for handling Redis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial added in v1.0.15

func Dial(url string, opts ...Opt) (*redis.Client, error)

Dial creates a connection to Redis and returns *redis.Client instance.

Types

type Config

type Config struct {
	// ConnectionTimeout is a maximum time client should spend trying to connect (default: 5s).
	ConnectionTimeout time.Duration

	// NoPing indicates whether Dial should skip the initial call to Ping method (default: false).
	NoPing bool
	// contains filtered or unexported fields
}

Config holds a configuration for Dial call.

type Opt

type Opt = func(*Config)

Opt is an option to be specified to Dial.

func ConnectionTimeout

func ConnectionTimeout(connectionTimeout time.Duration) Opt

ConnectionTimeout is a maximum time client should spend trying to connect.

func NoPing added in v1.0.15

func NoPing() Opt

NoPing indicates that Dial should skip the initial call to Ping method.

func Options added in v1.0.38

func Options(redisOpt func(options *redis.Options)) Opt

Options sets a function that allows to customize redis options.

Jump to

Keyboard shortcuts

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