cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cache_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cache.Cache",
	HandlerType: (*CacheServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Init",
			Handler:    _Cache_Init_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Cache_Get_Handler,
		},
		{
			MethodName: "Put",
			Handler:    _Cache_Put_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Cache_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cache.proto",
}

Cache_ServiceDesc is the grpc.ServiceDesc for Cache service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_cache_proto protoreflect.FileDescriptor

Functions

func RegisterCacheServer

func RegisterCacheServer(s grpc.ServiceRegistrar, srv CacheServer)

Types

type CacheClient

type CacheClient interface {
	Init(ctx context.Context, in *SettingRequest, opts ...grpc.CallOption) (*Empty, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*Empty, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*Empty, error)
}

CacheClient is the client API for Cache service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewCacheClient

func NewCacheClient(cc grpc.ClientConnInterface) CacheClient

type CacheServer

type CacheServer interface {
	Init(context.Context, *SettingRequest) (*Empty, error)
	Get(context.Context, *GetRequest) (*GetResponse, error)
	Put(context.Context, *PutRequest) (*Empty, error)
	Delete(context.Context, *DeleteRequest) (*Empty, error)
	// contains filtered or unexported methods
}

CacheServer is the server API for Cache service. All implementations must embed UnimplementedCacheServer for forward compatibility

type DeleteRequest

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

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetKey

func (x *DeleteRequest) GetKey() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type Empty

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

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) 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

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

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

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetValue

func (x *GetResponse) GetValue() string

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type PutRequest

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

func (*PutRequest) Descriptor deprecated

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

Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.

func (*PutRequest) GetKey

func (x *PutRequest) GetKey() string

func (*PutRequest) GetValue

func (x *PutRequest) GetValue() string

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) ProtoReflect

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

func (*PutRequest) Reset

func (x *PutRequest) Reset()

func (*PutRequest) String

func (x *PutRequest) String() string

type SettingRequest

type SettingRequest struct {
	Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	CacheTime int32    `protobuf:"varint,2,opt,name=cacheTime,proto3" json:"cacheTime,omitempty"`
	UserName  string   `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName,omitempty"`
	Password  string   `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*SettingRequest) Descriptor deprecated

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

Deprecated: Use SettingRequest.ProtoReflect.Descriptor instead.

func (*SettingRequest) GetCacheTime

func (x *SettingRequest) GetCacheTime() int32

func (*SettingRequest) GetEndpoints

func (x *SettingRequest) GetEndpoints() []string

func (*SettingRequest) GetPassword

func (x *SettingRequest) GetPassword() string

func (*SettingRequest) GetUserName

func (x *SettingRequest) GetUserName() string

func (*SettingRequest) ProtoMessage

func (*SettingRequest) ProtoMessage()

func (*SettingRequest) ProtoReflect

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

func (*SettingRequest) Reset

func (x *SettingRequest) Reset()

func (*SettingRequest) String

func (x *SettingRequest) String() string

type UnimplementedCacheServer

type UnimplementedCacheServer struct {
}

UnimplementedCacheServer must be embedded to have forward compatible implementations.

func (UnimplementedCacheServer) Delete

func (UnimplementedCacheServer) Get

func (UnimplementedCacheServer) Init

func (UnimplementedCacheServer) Put

type UnsafeCacheServer

type UnsafeCacheServer interface {
	// contains filtered or unexported methods
}

UnsafeCacheServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CacheServer will result in compilation errors.

Jump to

Keyboard shortcuts

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