Back to

Package redis

Latest Go to latest

The latest major version is .

Published: Jul 31, 2020 | License: BSD-3-Clause | Module:


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


func AddrFromEnv

func AddrFromEnv() (string, error)

AddrFromEnv returns redis server address from environment variables.

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier