Documentation ¶
Index ¶
- Variables
- func RegisterCalculatorServer(s grpc.ServiceRegistrar, srv CalculatorServer)
- type CalculationRequest
- func (*CalculationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CalculationRequest) GetA() int64
- func (x *CalculationRequest) GetB() int64
- func (*CalculationRequest) ProtoMessage()
- func (x *CalculationRequest) ProtoReflect() protoreflect.Message
- func (x *CalculationRequest) Reset()
- func (x *CalculationRequest) String() string
- type CalculationResponse
- func (*CalculationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CalculationResponse) GetResult() int64
- func (*CalculationResponse) ProtoMessage()
- func (x *CalculationResponse) ProtoReflect() protoreflect.Message
- func (x *CalculationResponse) Reset()
- func (x *CalculationResponse) String() string
- type CalculatorClient
- type CalculatorServer
- type NumbersRequest
- type UnimplementedCalculatorServer
- func (UnimplementedCalculatorServer) Add(context.Context, *CalculationRequest) (*CalculationResponse, error)
- func (UnimplementedCalculatorServer) Divide(context.Context, *CalculationRequest) (*CalculationResponse, error)
- func (UnimplementedCalculatorServer) Multiply(context.Context, *CalculationRequest) (*CalculationResponse, error)
- func (UnimplementedCalculatorServer) Sub(context.Context, *CalculationRequest) (*CalculationResponse, error)
- func (UnimplementedCalculatorServer) Sum(context.Context, *NumbersRequest) (*CalculationResponse, error)
- type UnsafeCalculatorServer
Constants ¶
This section is empty.
Variables ¶
var Calculator_ServiceDesc = grpc.ServiceDesc{ ServiceName: "calculator.Calculator", HandlerType: (*CalculatorServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Add", Handler: _Calculator_Add_Handler, }, { MethodName: "Divide", Handler: _Calculator_Divide_Handler, }, { MethodName: "Sum", Handler: _Calculator_Sum_Handler, }, { MethodName: "Sub", Handler: _Calculator_Sub_Handler, }, { MethodName: "Multiply", Handler: _Calculator_Multiply_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "calculator.proto", }
Calculator_ServiceDesc is the grpc.ServiceDesc for Calculator service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_calculator_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCalculatorServer ¶
func RegisterCalculatorServer(s grpc.ServiceRegistrar, srv CalculatorServer)
Types ¶
type CalculationRequest ¶
type CalculationRequest struct { A int64 `protobuf:"varint,1,opt,name=a,proto3" json:"a,omitempty"` B int64 `protobuf:"varint,2,opt,name=b,proto3" json:"b,omitempty"` // contains filtered or unexported fields }
func (*CalculationRequest) Descriptor
deprecated
func (*CalculationRequest) Descriptor() ([]byte, []int)
Deprecated: Use CalculationRequest.ProtoReflect.Descriptor instead.
func (*CalculationRequest) GetA ¶
func (x *CalculationRequest) GetA() int64
func (*CalculationRequest) GetB ¶
func (x *CalculationRequest) GetB() int64
func (*CalculationRequest) ProtoMessage ¶
func (*CalculationRequest) ProtoMessage()
func (*CalculationRequest) ProtoReflect ¶
func (x *CalculationRequest) ProtoReflect() protoreflect.Message
func (*CalculationRequest) Reset ¶
func (x *CalculationRequest) Reset()
func (*CalculationRequest) String ¶
func (x *CalculationRequest) String() string
type CalculationResponse ¶
type CalculationResponse struct { Result int64 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*CalculationResponse) Descriptor
deprecated
func (*CalculationResponse) Descriptor() ([]byte, []int)
Deprecated: Use CalculationResponse.ProtoReflect.Descriptor instead.
func (*CalculationResponse) GetResult ¶
func (x *CalculationResponse) GetResult() int64
func (*CalculationResponse) ProtoMessage ¶
func (*CalculationResponse) ProtoMessage()
func (*CalculationResponse) ProtoReflect ¶
func (x *CalculationResponse) ProtoReflect() protoreflect.Message
func (*CalculationResponse) Reset ¶
func (x *CalculationResponse) Reset()
func (*CalculationResponse) String ¶
func (x *CalculationResponse) String() string
type CalculatorClient ¶
type CalculatorClient interface { Add(ctx context.Context, in *CalculationRequest, opts ...grpc.CallOption) (*CalculationResponse, error) Divide(ctx context.Context, in *CalculationRequest, opts ...grpc.CallOption) (*CalculationResponse, error) Sum(ctx context.Context, in *NumbersRequest, opts ...grpc.CallOption) (*CalculationResponse, error) Sub(ctx context.Context, in *CalculationRequest, opts ...grpc.CallOption) (*CalculationResponse, error) Multiply(ctx context.Context, in *CalculationRequest, opts ...grpc.CallOption) (*CalculationResponse, error) }
CalculatorClient is the client API for Calculator 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 NewCalculatorClient ¶
func NewCalculatorClient(cc grpc.ClientConnInterface) CalculatorClient
type CalculatorServer ¶
type CalculatorServer interface { Add(context.Context, *CalculationRequest) (*CalculationResponse, error) Divide(context.Context, *CalculationRequest) (*CalculationResponse, error) Sum(context.Context, *NumbersRequest) (*CalculationResponse, error) Sub(context.Context, *CalculationRequest) (*CalculationResponse, error) Multiply(context.Context, *CalculationRequest) (*CalculationResponse, error) // contains filtered or unexported methods }
CalculatorServer is the server API for Calculator service. All implementations must embed UnimplementedCalculatorServer for forward compatibility
type NumbersRequest ¶
type NumbersRequest struct { Numbers []int64 `protobuf:"varint,1,rep,packed,name=numbers,proto3" json:"numbers,omitempty"` // contains filtered or unexported fields }
func (*NumbersRequest) Descriptor
deprecated
func (*NumbersRequest) Descriptor() ([]byte, []int)
Deprecated: Use NumbersRequest.ProtoReflect.Descriptor instead.
func (*NumbersRequest) GetNumbers ¶
func (x *NumbersRequest) GetNumbers() []int64
func (*NumbersRequest) ProtoMessage ¶
func (*NumbersRequest) ProtoMessage()
func (*NumbersRequest) ProtoReflect ¶
func (x *NumbersRequest) ProtoReflect() protoreflect.Message
func (*NumbersRequest) Reset ¶
func (x *NumbersRequest) Reset()
func (*NumbersRequest) String ¶
func (x *NumbersRequest) String() string
type UnimplementedCalculatorServer ¶
type UnimplementedCalculatorServer struct { }
UnimplementedCalculatorServer must be embedded to have forward compatible implementations.
func (UnimplementedCalculatorServer) Add ¶
func (UnimplementedCalculatorServer) Add(context.Context, *CalculationRequest) (*CalculationResponse, error)
func (UnimplementedCalculatorServer) Divide ¶
func (UnimplementedCalculatorServer) Divide(context.Context, *CalculationRequest) (*CalculationResponse, error)
func (UnimplementedCalculatorServer) Multiply ¶
func (UnimplementedCalculatorServer) Multiply(context.Context, *CalculationRequest) (*CalculationResponse, error)
func (UnimplementedCalculatorServer) Sub ¶
func (UnimplementedCalculatorServer) Sub(context.Context, *CalculationRequest) (*CalculationResponse, error)
func (UnimplementedCalculatorServer) Sum ¶
func (UnimplementedCalculatorServer) Sum(context.Context, *NumbersRequest) (*CalculationResponse, error)
type UnsafeCalculatorServer ¶
type UnsafeCalculatorServer interface {
// contains filtered or unexported methods
}
UnsafeCalculatorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CalculatorServer will result in compilation errors.