redis

package
v1.17.0-beta.14 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TTL                    int    = 300
	Scope                  string = "https://www.googleapis.com/auth/cloud-platform"
	PrefixServicesAccounts string = "projects/-/serviceAccounts/"
	ModeStandalone         Mode   = "standalone"
	ModeSentinel           Mode   = "sentinel"
	ModeCluster            Mode   = "cluster"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode added in v1.17.0

type Mode string

Mode define the Redis connection mode supported

type RedisConnection

type RedisConnection struct {
	Mode               Mode
	Address            []string
	DB                 int
	MasterName         string
	Password           string
	Protocol           int
	UseTLS             bool
	Logger             log.Logger
	Connected          bool
	Client             redis.UniversalClient
	CACert             string
	UseGCPIAMAuth      bool
	ServiceAccountName string
	TokenLifeTime      time.Duration
	RefreshDuration    time.Duration
	// contains filtered or unexported fields
}

RedisConnection represents a Redis connection hub

func (*RedisConnection) BuildTLSConfig added in v1.17.0

func (rc *RedisConnection) BuildTLSConfig() (*tls.Config, error)

BuildTLSConfig generates a *tls.Config configuration #nosec G304

func (*RedisConnection) Close added in v1.12.1

func (rc *RedisConnection) Close() error

Close closes the Redis connection

func (*RedisConnection) Connect

func (rc *RedisConnection) Connect(ctx context.Context) error

Connect initializes a Redis connection

func (*RedisConnection) GetClient

func (rc *RedisConnection) GetClient(ctx context.Context) (redis.UniversalClient, error)

GetClient always returns a pointer to a Redis client

Jump to

Keyboard shortcuts

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