redis

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package redis provides cache service by redis (cloud memorystore).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrFromEnv

func AddrFromEnv() (string, error)

AddrFromEnv returns redis server address from environment variables.

Types

type Client

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

Client is cache service client for redis.

func NewClient

func NewClient(ctx context.Context, addr, prefix string) Client

NewClient creates new cache client for redis.

func (Client) Close

func (c Client) Close() error

Close releases the resources used by the client.

func (Client) Get

func (c Client) Get(ctx context.Context, in *pb.GetReq, opts ...grpc.CallOption) (*pb.GetResp, error)

Get fetches value for the key from redis.

func (Client) Put

func (c Client) Put(ctx context.Context, in *pb.PutReq, opts ...grpc.CallOption) (*pb.PutResp, error)

Put stores key:value pair on redis.

Jump to

Keyboard shortcuts

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