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.

                Source Files