Documentation ¶
Index ¶
- Variables
- func RegisterCounterServer(s grpc.ServiceRegistrar, srv CounterServer)
- func RegisterStorageServer(s grpc.ServiceRegistrar, srv StorageServer)
- type CounterClient
- type CounterServer
- type GetRequest
- type GetResponse
- type IncrementRequest
- func (*IncrementRequest) Descriptor() ([]byte, []int)deprecated
- func (x *IncrementRequest) GetKey() string
- func (x *IncrementRequest) GetStorageServer() uint32
- func (x *IncrementRequest) GetValue() int64
- func (*IncrementRequest) ProtoMessage()
- func (x *IncrementRequest) ProtoReflect() protoreflect.Message
- func (x *IncrementRequest) Reset()
- func (x *IncrementRequest) String() string
- type IncrementResponse
- type PutRequest
- type PutResponse
- type StorageClient
- type StorageServer
- type UnimplementedCounterServer
- type UnimplementedStorageServer
- type UnsafeCounterServer
- type UnsafeStorageServer
Constants ¶
This section is empty.
Variables ¶
var Counter_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Counter", HandlerType: (*CounterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Increment", Handler: _Counter_Increment_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/counter.proto", }
Counter_ServiceDesc is the grpc.ServiceDesc for Counter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_counter_proto protoreflect.FileDescriptor
var File_proto_storage_proto protoreflect.FileDescriptor
var Storage_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Storage", HandlerType: (*StorageServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _Storage_Get_Handler, }, { MethodName: "Put", Handler: _Storage_Put_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/storage.proto", }
Storage_ServiceDesc is the grpc.ServiceDesc for Storage service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterCounterServer ¶
func RegisterCounterServer(s grpc.ServiceRegistrar, srv CounterServer)
func RegisterStorageServer ¶
func RegisterStorageServer(s grpc.ServiceRegistrar, srv StorageServer)
Types ¶
type CounterClient ¶
type CounterClient interface {
Increment(ctx context.Context, in *IncrementRequest, opts ...grpc.CallOption) (*IncrementResponse, error)
}
CounterClient is the client API for Counter 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 NewCounterClient ¶
func NewCounterClient(cc grpc.ClientConnInterface) CounterClient
type CounterServer ¶
type CounterServer interface { Increment(context.Context, *IncrementRequest) (*IncrementResponse, error) // contains filtered or unexported methods }
CounterServer is the server API for Counter service. All implementations must embed UnimplementedCounterServer for forward compatibility
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 int64 `protobuf:"varint,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() int64
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 IncrementRequest ¶
type IncrementRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` StorageServer uint32 `protobuf:"varint,3,opt,name=storage_server,json=storageServer,proto3" json:"storage_server,omitempty"` // contains filtered or unexported fields }
func (*IncrementRequest) Descriptor
deprecated
func (*IncrementRequest) Descriptor() ([]byte, []int)
Deprecated: Use IncrementRequest.ProtoReflect.Descriptor instead.
func (*IncrementRequest) GetKey ¶
func (x *IncrementRequest) GetKey() string
func (*IncrementRequest) GetStorageServer ¶
func (x *IncrementRequest) GetStorageServer() uint32
func (*IncrementRequest) GetValue ¶
func (x *IncrementRequest) GetValue() int64
func (*IncrementRequest) ProtoMessage ¶
func (*IncrementRequest) ProtoMessage()
func (*IncrementRequest) ProtoReflect ¶
func (x *IncrementRequest) ProtoReflect() protoreflect.Message
func (*IncrementRequest) Reset ¶
func (x *IncrementRequest) Reset()
func (*IncrementRequest) String ¶
func (x *IncrementRequest) String() string
type IncrementResponse ¶
type IncrementResponse struct { Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*IncrementResponse) Descriptor
deprecated
func (*IncrementResponse) Descriptor() ([]byte, []int)
Deprecated: Use IncrementResponse.ProtoReflect.Descriptor instead.
func (*IncrementResponse) GetValue ¶
func (x *IncrementResponse) GetValue() int64
func (*IncrementResponse) ProtoMessage ¶
func (*IncrementResponse) ProtoMessage()
func (*IncrementResponse) ProtoReflect ¶
func (x *IncrementResponse) ProtoReflect() protoreflect.Message
func (*IncrementResponse) Reset ¶
func (x *IncrementResponse) Reset()
func (*IncrementResponse) String ¶
func (x *IncrementResponse) String() string
type PutRequest ¶
type PutRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value int64 `protobuf:"varint,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() int64
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 PutResponse ¶
type PutResponse struct {
// contains filtered or unexported fields
}
func (*PutResponse) Descriptor
deprecated
func (*PutResponse) Descriptor() ([]byte, []int)
Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) ProtoReflect ¶
func (x *PutResponse) ProtoReflect() protoreflect.Message
func (*PutResponse) Reset ¶
func (x *PutResponse) Reset()
func (*PutResponse) String ¶
func (x *PutResponse) String() string
type StorageClient ¶
type StorageClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) }
StorageClient is the client API for Storage 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 NewStorageClient ¶
func NewStorageClient(cc grpc.ClientConnInterface) StorageClient
type StorageServer ¶
type StorageServer interface { Get(context.Context, *GetRequest) (*GetResponse, error) Put(context.Context, *PutRequest) (*PutResponse, error) // contains filtered or unexported methods }
StorageServer is the server API for Storage service. All implementations must embed UnimplementedStorageServer for forward compatibility
type UnimplementedCounterServer ¶
type UnimplementedCounterServer struct { }
UnimplementedCounterServer must be embedded to have forward compatible implementations.
func (UnimplementedCounterServer) Increment ¶
func (UnimplementedCounterServer) Increment(context.Context, *IncrementRequest) (*IncrementResponse, error)
type UnimplementedStorageServer ¶
type UnimplementedStorageServer struct { }
UnimplementedStorageServer must be embedded to have forward compatible implementations.
func (UnimplementedStorageServer) Get ¶
func (UnimplementedStorageServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (UnimplementedStorageServer) Put ¶
func (UnimplementedStorageServer) Put(context.Context, *PutRequest) (*PutResponse, error)
type UnsafeCounterServer ¶
type UnsafeCounterServer interface {
// contains filtered or unexported methods
}
UnsafeCounterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CounterServer will result in compilation errors.
type UnsafeStorageServer ¶
type UnsafeStorageServer interface {
// contains filtered or unexported methods
}
UnsafeStorageServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StorageServer will result in compilation errors.