util

package
v3.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2016 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExpireAt

func GetExpireAt(leaderboardPublicID string) (int64, error)

GetExpireAt returns a timestamp when the key should expire or -1 if the key doesn't match any valid auto expire regexes

Types

type InvalidDurationError

type InvalidDurationError struct {
	LeaderboardPublicID string
	DurationInSeconds   int64
}

InvalidDurationError identifies that a given key generates an invalid duration

func (*InvalidDurationError) Error

func (e *InvalidDurationError) Error() string

type RedisClient

type RedisClient struct {
	Logger zap.Logger
	Client *redis.Client
}

RedisClient identifies uniquely one redis client with a pool of connections

func GetRedisClient

func GetRedisClient(redisHost string, redisPort int, redisPassword string, redisDB int, maxPoolSize int, logger zap.Logger) (*RedisClient, error)

GetRedisClient creates and returns a new redis client based on the given settings

func (*RedisClient) GetConnection

func (c *RedisClient) GetConnection() *redis.Client

GetConnection return a redis connection

Jump to

Keyboard shortcuts

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