client

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package client implements a gRPC client for the cache service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	Get(ctx context.Context, key string) (keyExists bool, value []byte, err error)
	Set(ctx context.Context, key string, value []byte) error
	Close() error
}

Cacher specifies an interface for remote clients connecting to the cache service.

type Client

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

Client represents a gRPC cache service client.

func New

func New(conn *grpc.ClientConn) (p *Client)

New returns a new gRPC cache service client.

func (*Client) Close

func (a *Client) Close() error

Close tears down the ClientConn and all underlying connections.

func (*Client) Get

func (a *Client) Get(ctx context.Context, key string) (keyExists bool, value []byte, err error)

Get retrieves a value from the cache service.

func (*Client) Set

func (a *Client) Set(ctx context.Context, key string, value []byte) error

Set stores a key value pair in the cache service.

Jump to

Keyboard shortcuts

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