cache

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCacheInstance

func CreateCacheInstance() error

creates the Memorystore Redis instance

func DeleteCacheInstance added in v0.0.2

func DeleteCacheInstance() error

deletes the Memorystore Redis instance

func FindCacheInstance

func FindCacheInstance() (*redispb.Instance, error)

using redis sdk try and find instance details i.e. host ip and port (instance might not exist!)

func Get

func Get(key string) ([]byte, error)

get value from redis

func IncrementCounter

func IncrementCounter(key string) (int, error)

func NewPool

func NewPool(addr string) *redis.Pool

create redis connection pools

func PeriodicallyPollForCache

func PeriodicallyPollForCache()

continuously check if memory store is available if not currently working this is incase instances stay live for extended periods while the cache is being created

func Ping

func Ping(c redis.Conn) error

func PreloadCache

func PreloadCache(keyColumn int) error

query BigQuery for all rows in table and put into redis (preloading the cache) keyColumn is the column number which you want to use for your redis key for each row

func Set

func Set(key string, value []byte) error

set value to redis

func ValidateMemoryStoreAndCreatePool

func ValidateMemoryStoreAndCreatePool()

if cache has failed (or first run) poll for redis instance information

Types

This section is empty.

Jump to

Keyboard shortcuts

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