redis

package
v0.0.0-...-cb0b8ae Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache(config CacheConfig) (github.Cache, error)

NewCache returns a new Redis-based implementation of the github.Cache interface.

Types

type CacheConfig

type CacheConfig struct {
	RedisHost      string `envconfig:"REDIS_HOST"`
	RedisPort      int    `envconfig:"REDIS_PORT"`
	RedisPassword  string `envconfig:"REDIS_PASSWORD"`
	RedisDB        int    `envconfig:"REDIS_DB"`
	RedisEnableTLS bool   `envconfig:"REDIS_ENABLE_TLS"`
	RedisPrefix    string `envconfig:"REDIS_PREFIX"`
}

CacheConfig represents configuration options for the Redis-based implementation of the github.Cache interface

func GetCacheConfigFromEnvironment

func GetCacheConfigFromEnvironment() (CacheConfig, error)

GetCacheConfigFromEnvironment returns configuration derived from environment variables

func NewCacheConfigWithDefaults

func NewCacheConfigWithDefaults() CacheConfig

NewCacheConfigWithDefaults returns a CacheConfig object with default values already applied. Callers are then free to set custom values for the remaining fields and/or override default values.

Jump to

Keyboard shortcuts

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