Documentation ¶
Index ¶
- Variables
- func RegisterCalculatorServiceServer(s *grpc.Server, srv CalculatorServiceServer)
- type CalculatorServiceClient
- type CalculatorServiceServer
- type CalculatorService_ComputeAverageClient
- type CalculatorService_ComputeAverageServer
- type CalculatorService_FindMaximumClient
- type CalculatorService_FindMaximumServer
- type CalculatorService_PrimeNumberDecompositionClient
- type CalculatorService_PrimeNumberDecompositionServer
- type ComputeAverageRequest
- func (*ComputeAverageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ComputeAverageRequest) GetNumber() int32
- func (*ComputeAverageRequest) ProtoMessage()
- func (x *ComputeAverageRequest) ProtoReflect() protoreflect.Message
- func (x *ComputeAverageRequest) Reset()
- func (x *ComputeAverageRequest) String() string
- type ComputeAverageResponse
- func (*ComputeAverageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ComputeAverageResponse) GetAverage() float64
- func (*ComputeAverageResponse) ProtoMessage()
- func (x *ComputeAverageResponse) ProtoReflect() protoreflect.Message
- func (x *ComputeAverageResponse) Reset()
- func (x *ComputeAverageResponse) String() string
- type FindMaximumRequest
- func (*FindMaximumRequest) Descriptor() ([]byte, []int)deprecated
- func (x *FindMaximumRequest) GetNumber() int32
- func (*FindMaximumRequest) ProtoMessage()
- func (x *FindMaximumRequest) ProtoReflect() protoreflect.Message
- func (x *FindMaximumRequest) Reset()
- func (x *FindMaximumRequest) String() string
- type FindMaximumResponse
- func (*FindMaximumResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FindMaximumResponse) GetMaximum() int32
- func (*FindMaximumResponse) ProtoMessage()
- func (x *FindMaximumResponse) ProtoReflect() protoreflect.Message
- func (x *FindMaximumResponse) Reset()
- func (x *FindMaximumResponse) String() string
- type PrimeNumberDecompositionRequest
- func (*PrimeNumberDecompositionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PrimeNumberDecompositionRequest) GetNumber() int64
- func (*PrimeNumberDecompositionRequest) ProtoMessage()
- func (x *PrimeNumberDecompositionRequest) ProtoReflect() protoreflect.Message
- func (x *PrimeNumberDecompositionRequest) Reset()
- func (x *PrimeNumberDecompositionRequest) String() string
- type PrimeNumberDecompositionResponse
- func (*PrimeNumberDecompositionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PrimeNumberDecompositionResponse) GetPrimeFactor() int64
- func (*PrimeNumberDecompositionResponse) ProtoMessage()
- func (x *PrimeNumberDecompositionResponse) ProtoReflect() protoreflect.Message
- func (x *PrimeNumberDecompositionResponse) Reset()
- func (x *PrimeNumberDecompositionResponse) String() string
- type SquareRootRequest
- type SquareRootResponse
- func (*SquareRootResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SquareRootResponse) GetNumberRoot() float64
- func (*SquareRootResponse) ProtoMessage()
- func (x *SquareRootResponse) ProtoReflect() protoreflect.Message
- func (x *SquareRootResponse) Reset()
- func (x *SquareRootResponse) String() string
- type SumRequest
- func (*SumRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SumRequest) GetFirstNumber() int32
- func (x *SumRequest) GetSecondNumber() int32
- func (*SumRequest) ProtoMessage()
- func (x *SumRequest) ProtoReflect() protoreflect.Message
- func (x *SumRequest) Reset()
- func (x *SumRequest) String() string
- type SumResponse
- type UnimplementedCalculatorServiceServer
- func (*UnimplementedCalculatorServiceServer) ComputeAverage(CalculatorService_ComputeAverageServer) error
- func (*UnimplementedCalculatorServiceServer) FindMaximum(CalculatorService_FindMaximumServer) error
- func (*UnimplementedCalculatorServiceServer) PrimeNumberDecomposition(*PrimeNumberDecompositionRequest, ...) error
- func (*UnimplementedCalculatorServiceServer) SquareRoot(context.Context, *SquareRootRequest) (*SquareRootResponse, error)
- func (*UnimplementedCalculatorServiceServer) Sum(context.Context, *SumRequest) (*SumResponse, error)
Constants ¶
This section is empty.
Variables ¶
var File_calculator_calculatorpb_calculator_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCalculatorServiceServer ¶
func RegisterCalculatorServiceServer(s *grpc.Server, srv CalculatorServiceServer)
Types ¶
type CalculatorServiceClient ¶
type CalculatorServiceClient interface { Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumResponse, error) PrimeNumberDecomposition(ctx context.Context, in *PrimeNumberDecompositionRequest, opts ...grpc.CallOption) (CalculatorService_PrimeNumberDecompositionClient, error) ComputeAverage(ctx context.Context, opts ...grpc.CallOption) (CalculatorService_ComputeAverageClient, error) FindMaximum(ctx context.Context, opts ...grpc.CallOption) (CalculatorService_FindMaximumClient, error) // error handling // this RPC will throw an exception if the sent number is negative // The error being sent is of type INVALID_ARGUMENT SquareRoot(ctx context.Context, in *SquareRootRequest, opts ...grpc.CallOption) (*SquareRootResponse, error) }
CalculatorServiceClient is the client API for CalculatorService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCalculatorServiceClient ¶
func NewCalculatorServiceClient(cc grpc.ClientConnInterface) CalculatorServiceClient
type CalculatorServiceServer ¶
type CalculatorServiceServer interface { Sum(context.Context, *SumRequest) (*SumResponse, error) PrimeNumberDecomposition(*PrimeNumberDecompositionRequest, CalculatorService_PrimeNumberDecompositionServer) error ComputeAverage(CalculatorService_ComputeAverageServer) error FindMaximum(CalculatorService_FindMaximumServer) error // error handling // this RPC will throw an exception if the sent number is negative // The error being sent is of type INVALID_ARGUMENT SquareRoot(context.Context, *SquareRootRequest) (*SquareRootResponse, error) }
CalculatorServiceServer is the server API for CalculatorService service.
type CalculatorService_ComputeAverageClient ¶
type CalculatorService_ComputeAverageClient interface { Send(*ComputeAverageRequest) error CloseAndRecv() (*ComputeAverageResponse, error) grpc.ClientStream }
type CalculatorService_ComputeAverageServer ¶
type CalculatorService_ComputeAverageServer interface { SendAndClose(*ComputeAverageResponse) error Recv() (*ComputeAverageRequest, error) grpc.ServerStream }
type CalculatorService_FindMaximumClient ¶
type CalculatorService_FindMaximumClient interface { Send(*FindMaximumRequest) error Recv() (*FindMaximumResponse, error) grpc.ClientStream }
type CalculatorService_FindMaximumServer ¶
type CalculatorService_FindMaximumServer interface { Send(*FindMaximumResponse) error Recv() (*FindMaximumRequest, error) grpc.ServerStream }
type CalculatorService_PrimeNumberDecompositionClient ¶
type CalculatorService_PrimeNumberDecompositionClient interface { Recv() (*PrimeNumberDecompositionResponse, error) grpc.ClientStream }
type CalculatorService_PrimeNumberDecompositionServer ¶
type CalculatorService_PrimeNumberDecompositionServer interface { Send(*PrimeNumberDecompositionResponse) error grpc.ServerStream }
type ComputeAverageRequest ¶
type ComputeAverageRequest struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*ComputeAverageRequest) Descriptor
deprecated
func (*ComputeAverageRequest) Descriptor() ([]byte, []int)
Deprecated: Use ComputeAverageRequest.ProtoReflect.Descriptor instead.
func (*ComputeAverageRequest) GetNumber ¶
func (x *ComputeAverageRequest) GetNumber() int32
func (*ComputeAverageRequest) ProtoMessage ¶
func (*ComputeAverageRequest) ProtoMessage()
func (*ComputeAverageRequest) ProtoReflect ¶
func (x *ComputeAverageRequest) ProtoReflect() protoreflect.Message
func (*ComputeAverageRequest) Reset ¶
func (x *ComputeAverageRequest) Reset()
func (*ComputeAverageRequest) String ¶
func (x *ComputeAverageRequest) String() string
type ComputeAverageResponse ¶
type ComputeAverageResponse struct { Average float64 `protobuf:"fixed64,1,opt,name=average,proto3" json:"average,omitempty"` // contains filtered or unexported fields }
func (*ComputeAverageResponse) Descriptor
deprecated
func (*ComputeAverageResponse) Descriptor() ([]byte, []int)
Deprecated: Use ComputeAverageResponse.ProtoReflect.Descriptor instead.
func (*ComputeAverageResponse) GetAverage ¶
func (x *ComputeAverageResponse) GetAverage() float64
func (*ComputeAverageResponse) ProtoMessage ¶
func (*ComputeAverageResponse) ProtoMessage()
func (*ComputeAverageResponse) ProtoReflect ¶
func (x *ComputeAverageResponse) ProtoReflect() protoreflect.Message
func (*ComputeAverageResponse) Reset ¶
func (x *ComputeAverageResponse) Reset()
func (*ComputeAverageResponse) String ¶
func (x *ComputeAverageResponse) String() string
type FindMaximumRequest ¶
type FindMaximumRequest struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*FindMaximumRequest) Descriptor
deprecated
func (*FindMaximumRequest) Descriptor() ([]byte, []int)
Deprecated: Use FindMaximumRequest.ProtoReflect.Descriptor instead.
func (*FindMaximumRequest) GetNumber ¶
func (x *FindMaximumRequest) GetNumber() int32
func (*FindMaximumRequest) ProtoMessage ¶
func (*FindMaximumRequest) ProtoMessage()
func (*FindMaximumRequest) ProtoReflect ¶
func (x *FindMaximumRequest) ProtoReflect() protoreflect.Message
func (*FindMaximumRequest) Reset ¶
func (x *FindMaximumRequest) Reset()
func (*FindMaximumRequest) String ¶
func (x *FindMaximumRequest) String() string
type FindMaximumResponse ¶
type FindMaximumResponse struct { Maximum int32 `protobuf:"varint,1,opt,name=maximum,proto3" json:"maximum,omitempty"` // contains filtered or unexported fields }
func (*FindMaximumResponse) Descriptor
deprecated
func (*FindMaximumResponse) Descriptor() ([]byte, []int)
Deprecated: Use FindMaximumResponse.ProtoReflect.Descriptor instead.
func (*FindMaximumResponse) GetMaximum ¶
func (x *FindMaximumResponse) GetMaximum() int32
func (*FindMaximumResponse) ProtoMessage ¶
func (*FindMaximumResponse) ProtoMessage()
func (*FindMaximumResponse) ProtoReflect ¶
func (x *FindMaximumResponse) ProtoReflect() protoreflect.Message
func (*FindMaximumResponse) Reset ¶
func (x *FindMaximumResponse) Reset()
func (*FindMaximumResponse) String ¶
func (x *FindMaximumResponse) String() string
type PrimeNumberDecompositionRequest ¶
type PrimeNumberDecompositionRequest struct { Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*PrimeNumberDecompositionRequest) Descriptor
deprecated
func (*PrimeNumberDecompositionRequest) Descriptor() ([]byte, []int)
Deprecated: Use PrimeNumberDecompositionRequest.ProtoReflect.Descriptor instead.
func (*PrimeNumberDecompositionRequest) GetNumber ¶
func (x *PrimeNumberDecompositionRequest) GetNumber() int64
func (*PrimeNumberDecompositionRequest) ProtoMessage ¶
func (*PrimeNumberDecompositionRequest) ProtoMessage()
func (*PrimeNumberDecompositionRequest) ProtoReflect ¶
func (x *PrimeNumberDecompositionRequest) ProtoReflect() protoreflect.Message
func (*PrimeNumberDecompositionRequest) Reset ¶
func (x *PrimeNumberDecompositionRequest) Reset()
func (*PrimeNumberDecompositionRequest) String ¶
func (x *PrimeNumberDecompositionRequest) String() string
type PrimeNumberDecompositionResponse ¶
type PrimeNumberDecompositionResponse struct { PrimeFactor int64 `protobuf:"varint,1,opt,name=prime_factor,json=primeFactor,proto3" json:"prime_factor,omitempty"` // contains filtered or unexported fields }
func (*PrimeNumberDecompositionResponse) Descriptor
deprecated
func (*PrimeNumberDecompositionResponse) Descriptor() ([]byte, []int)
Deprecated: Use PrimeNumberDecompositionResponse.ProtoReflect.Descriptor instead.
func (*PrimeNumberDecompositionResponse) GetPrimeFactor ¶
func (x *PrimeNumberDecompositionResponse) GetPrimeFactor() int64
func (*PrimeNumberDecompositionResponse) ProtoMessage ¶
func (*PrimeNumberDecompositionResponse) ProtoMessage()
func (*PrimeNumberDecompositionResponse) ProtoReflect ¶
func (x *PrimeNumberDecompositionResponse) ProtoReflect() protoreflect.Message
func (*PrimeNumberDecompositionResponse) Reset ¶
func (x *PrimeNumberDecompositionResponse) Reset()
func (*PrimeNumberDecompositionResponse) String ¶
func (x *PrimeNumberDecompositionResponse) String() string
type SquareRootRequest ¶
type SquareRootRequest struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // contains filtered or unexported fields }
func (*SquareRootRequest) Descriptor
deprecated
func (*SquareRootRequest) Descriptor() ([]byte, []int)
Deprecated: Use SquareRootRequest.ProtoReflect.Descriptor instead.
func (*SquareRootRequest) GetNumber ¶
func (x *SquareRootRequest) GetNumber() int32
func (*SquareRootRequest) ProtoMessage ¶
func (*SquareRootRequest) ProtoMessage()
func (*SquareRootRequest) ProtoReflect ¶
func (x *SquareRootRequest) ProtoReflect() protoreflect.Message
func (*SquareRootRequest) Reset ¶
func (x *SquareRootRequest) Reset()
func (*SquareRootRequest) String ¶
func (x *SquareRootRequest) String() string
type SquareRootResponse ¶
type SquareRootResponse struct { NumberRoot float64 `protobuf:"fixed64,1,opt,name=number_root,json=numberRoot,proto3" json:"number_root,omitempty"` // contains filtered or unexported fields }
func (*SquareRootResponse) Descriptor
deprecated
func (*SquareRootResponse) Descriptor() ([]byte, []int)
Deprecated: Use SquareRootResponse.ProtoReflect.Descriptor instead.
func (*SquareRootResponse) GetNumberRoot ¶
func (x *SquareRootResponse) GetNumberRoot() float64
func (*SquareRootResponse) ProtoMessage ¶
func (*SquareRootResponse) ProtoMessage()
func (*SquareRootResponse) ProtoReflect ¶
func (x *SquareRootResponse) ProtoReflect() protoreflect.Message
func (*SquareRootResponse) Reset ¶
func (x *SquareRootResponse) Reset()
func (*SquareRootResponse) String ¶
func (x *SquareRootResponse) String() string
type SumRequest ¶
type SumRequest struct { FirstNumber int32 `protobuf:"varint,1,opt,name=first_number,json=firstNumber,proto3" json:"first_number,omitempty"` SecondNumber int32 `protobuf:"varint,2,opt,name=second_number,json=secondNumber,proto3" json:"second_number,omitempty"` // contains filtered or unexported fields }
func (*SumRequest) Descriptor
deprecated
func (*SumRequest) Descriptor() ([]byte, []int)
Deprecated: Use SumRequest.ProtoReflect.Descriptor instead.
func (*SumRequest) GetFirstNumber ¶
func (x *SumRequest) GetFirstNumber() int32
func (*SumRequest) GetSecondNumber ¶
func (x *SumRequest) GetSecondNumber() int32
func (*SumRequest) ProtoMessage ¶
func (*SumRequest) ProtoMessage()
func (*SumRequest) ProtoReflect ¶
func (x *SumRequest) ProtoReflect() protoreflect.Message
func (*SumRequest) Reset ¶
func (x *SumRequest) Reset()
func (*SumRequest) String ¶
func (x *SumRequest) String() string
type SumResponse ¶
type SumResponse struct { SumResult int32 `protobuf:"varint,1,opt,name=sum_result,json=sumResult,proto3" json:"sum_result,omitempty"` // contains filtered or unexported fields }
func (*SumResponse) Descriptor
deprecated
func (*SumResponse) Descriptor() ([]byte, []int)
Deprecated: Use SumResponse.ProtoReflect.Descriptor instead.
func (*SumResponse) GetSumResult ¶
func (x *SumResponse) GetSumResult() int32
func (*SumResponse) ProtoMessage ¶
func (*SumResponse) ProtoMessage()
func (*SumResponse) ProtoReflect ¶
func (x *SumResponse) ProtoReflect() protoreflect.Message
func (*SumResponse) Reset ¶
func (x *SumResponse) Reset()
func (*SumResponse) String ¶
func (x *SumResponse) String() string
type UnimplementedCalculatorServiceServer ¶
type UnimplementedCalculatorServiceServer struct { }
UnimplementedCalculatorServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCalculatorServiceServer) ComputeAverage ¶
func (*UnimplementedCalculatorServiceServer) ComputeAverage(CalculatorService_ComputeAverageServer) error
func (*UnimplementedCalculatorServiceServer) FindMaximum ¶
func (*UnimplementedCalculatorServiceServer) FindMaximum(CalculatorService_FindMaximumServer) error
func (*UnimplementedCalculatorServiceServer) PrimeNumberDecomposition ¶
func (*UnimplementedCalculatorServiceServer) PrimeNumberDecomposition(*PrimeNumberDecompositionRequest, CalculatorService_PrimeNumberDecompositionServer) error
func (*UnimplementedCalculatorServiceServer) SquareRoot ¶
func (*UnimplementedCalculatorServiceServer) SquareRoot(context.Context, *SquareRootRequest) (*SquareRootResponse, error)
func (*UnimplementedCalculatorServiceServer) Sum ¶
func (*UnimplementedCalculatorServiceServer) Sum(context.Context, *SumRequest) (*SumResponse, error)