tlsredis

package module
v0.0.0-...-4e9e0ca Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Overview

Package tlsredis provides an API for obtaining gopkg.in/redis.v5 clients that can optionally do fancy TLS stuff like client certificates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(opts *Options) (*redis.Client, error)

GetClient gets a client for the given options, returning an existing client if we've already called GetClient with the same URL.

Types

type Options

type Options struct {
	redis.Options

	// RedisURL is the redis instance's URL in the form
	// redis://[user:pass@host:port]. Required.
	RedisURL string

	// RedisCAFile is a path to a PEM-encoded certificate for the CA that signs
	// the redis instance's server certificate. If not supplied, only the system
	// default trusted roots will be used.
	RedisCAFile string

	// ClientPKFile is a path to a PEM-encoded private key for the client to use
	// to authenticate itself to the redis stunnel. If not supplied, no client
	// authentication is performed.
	ClientPKFile string

	// ClientCertFile is a path to a PEM-encoded certificate for the client to use
	// to authenticate itself to the redis stunnel. If not supplied, no client
	// authentication is performed.
	ClientCertFile string

	// DialTimeout caps the amount of time we're willing to wait for a TCP
	// connection. Defaults to 30 seconds.
	DialTimeout time.Duration

	// TCPKeepAlive enables TCP keepalives on the connection to Redis.
	// If set to 0, keepalives are disabled.
	TCPKeepAlive time.Duration
}

Options provides options for configuring connectivity to Redis.

Jump to

Keyboard shortcuts

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