rediz

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package rediz includes helpers to access cache. Rightnow, we only use GET and SETEX (set with expiration).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client used to connect redis.

func (*Client) Close

func (s *Client) Close() error

Close returns the client to pool.

func (*Client) Get

func (s *Client) Get(key string) ([]byte, error)

Get a value associated with given key in redis.

func (*Client) SetWithExpiry

func (s *Client) SetWithExpiry(key string, value []byte, seconds int64) error

SetWithExpiry add a key-value pair with expiry in redis.

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool of redis connected clients.

func NewPool

func NewPool(address string) *Pool

NewPool creates the pool of redis clients. address in format: "host:port"

func (*Pool) Client

func (s *Pool) Client() *Client

Client gets a client from the pool. Must call client.Close() after use to return the client.

func (*Pool) Close

func (s *Pool) Close() error

Close the pool.

Jump to

Keyboard shortcuts

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