cache

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cache defines a Cacher interfaces that can be implemented by any key value store system.

Index

Constants

This section is empty.

Variables

View Source
var File_cache_proto protoreflect.FileDescriptor

Functions

func RegisterCacheServer

func RegisterCacheServer(s *grpc.Server, srv CacheServer)

Types

type CacheClient

type CacheClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error)
	Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetReply, error)
}

CacheClient is the client API for Cache service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewCacheClient

func NewCacheClient(cc grpc.ClientConnInterface) CacheClient

type CacheServer

type CacheServer interface {
	Get(context.Context, *GetRequest) (*GetReply, error)
	Set(context.Context, *SetRequest) (*SetReply, error)
}

CacheServer is the server API for Cache service.

type Cacher added in v0.9.0

type Cacher interface {
	Get(ctx context.Context, key string) (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 GetReply

type GetReply struct {
	Exists bool   `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"`
	Value  []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*GetReply) Descriptor deprecated

func (*GetReply) Descriptor() ([]byte, []int)

Deprecated: Use GetReply.ProtoReflect.Descriptor instead.

func (*GetReply) GetExists

func (x *GetReply) GetExists() bool

func (*GetReply) GetValue

func (x *GetReply) GetValue() []byte

func (*GetReply) ProtoMessage

func (*GetReply) ProtoMessage()

func (*GetReply) ProtoReflect added in v0.9.0

func (x *GetReply) ProtoReflect() protoreflect.Message

func (*GetReply) Reset

func (x *GetReply) Reset()

func (*GetReply) String

func (x *GetReply) String() string

type GetRequest

type GetRequest struct {
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

func (*GetRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetKey

func (x *GetRequest) GetKey() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect added in v0.9.0

func (x *GetRequest) ProtoReflect() protoreflect.Message

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type SetReply

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

func (*SetReply) Descriptor deprecated

func (*SetReply) Descriptor() ([]byte, []int)

Deprecated: Use SetReply.ProtoReflect.Descriptor instead.

func (*SetReply) ProtoMessage

func (*SetReply) ProtoMessage()

func (*SetReply) ProtoReflect added in v0.9.0

func (x *SetReply) ProtoReflect() protoreflect.Message

func (*SetReply) Reset

func (x *SetReply) Reset()

func (*SetReply) String

func (x *SetReply) String() string

type SetRequest

type SetRequest struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*SetRequest) Descriptor deprecated

func (*SetRequest) Descriptor() ([]byte, []int)

Deprecated: Use SetRequest.ProtoReflect.Descriptor instead.

func (*SetRequest) GetKey

func (x *SetRequest) GetKey() string

func (*SetRequest) GetValue

func (x *SetRequest) GetValue() []byte

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) ProtoReflect added in v0.9.0

func (x *SetRequest) ProtoReflect() protoreflect.Message

func (*SetRequest) Reset

func (x *SetRequest) Reset()

func (*SetRequest) String

func (x *SetRequest) String() string

type UnimplementedCacheServer

type UnimplementedCacheServer struct {
}

UnimplementedCacheServer can be embedded to have forward compatible implementations.

func (*UnimplementedCacheServer) Get

func (*UnimplementedCacheServer) Set

Directories

Path Synopsis
Package client implements a gRPC client for the cache service.
Package client implements a gRPC client for the cache service.
Package mock_cache is a generated GoMock package.
Package mock_cache is a generated GoMock package.

Jump to

Keyboard shortcuts

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