Documentation ¶
Index ¶
- Variables
- func RegisterCalculatorServer(s *grpc.Server, srv CalculatorServer)
- type CalculatorClient
- type CalculatorServer
- type Calculator_AddStreamClient
- type Calculator_AddStreamServer
- type Calculator_DivideStreamClient
- type Calculator_DivideStreamServer
- type Calculator_MultiplyStreamClient
- type Calculator_MultiplyStreamServer
- type Calculator_SubtractStreamClient
- type Calculator_SubtractStreamServer
- type Number
- type Numbers
- type UnimplementedCalculatorServer
- func (*UnimplementedCalculatorServer) Add(context.Context, *Numbers) (*Number, error)
- func (*UnimplementedCalculatorServer) AddStream(Calculator_AddStreamServer) error
- func (*UnimplementedCalculatorServer) Divide(context.Context, *Numbers) (*Number, error)
- func (*UnimplementedCalculatorServer) DivideStream(Calculator_DivideStreamServer) error
- func (*UnimplementedCalculatorServer) Multiply(context.Context, *Numbers) (*Number, error)
- func (*UnimplementedCalculatorServer) MultiplyStream(Calculator_MultiplyStreamServer) error
- func (*UnimplementedCalculatorServer) Subtract(context.Context, *Numbers) (*Number, error)
- func (*UnimplementedCalculatorServer) SubtractStream(Calculator_SubtractStreamServer) error
Constants ¶
This section is empty.
Variables ¶
View Source
var File_calculator_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCalculatorServer ¶
func RegisterCalculatorServer(s *grpc.Server, srv CalculatorServer)
Types ¶
type CalculatorClient ¶
type CalculatorClient interface { Add(ctx context.Context, in *Numbers, opts ...grpc.CallOption) (*Number, error) AddStream(ctx context.Context, opts ...grpc.CallOption) (Calculator_AddStreamClient, error) Subtract(ctx context.Context, in *Numbers, opts ...grpc.CallOption) (*Number, error) SubtractStream(ctx context.Context, opts ...grpc.CallOption) (Calculator_SubtractStreamClient, error) Multiply(ctx context.Context, in *Numbers, opts ...grpc.CallOption) (*Number, error) MultiplyStream(ctx context.Context, opts ...grpc.CallOption) (Calculator_MultiplyStreamClient, error) Divide(ctx context.Context, in *Numbers, opts ...grpc.CallOption) (*Number, error) DivideStream(ctx context.Context, opts ...grpc.CallOption) (Calculator_DivideStreamClient, 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, *Numbers) (*Number, error) AddStream(Calculator_AddStreamServer) error Subtract(context.Context, *Numbers) (*Number, error) SubtractStream(Calculator_SubtractStreamServer) error Multiply(context.Context, *Numbers) (*Number, error) MultiplyStream(Calculator_MultiplyStreamServer) error Divide(context.Context, *Numbers) (*Number, error) DivideStream(Calculator_DivideStreamServer) error // contains filtered or unexported methods }
CalculatorServer is the server API for Calculator service. All implementations must embed UnimplementedCalculatorServer for forward compatibility
type Number ¶
type Number struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Number) Descriptor
deprecated
func (*Number) ProtoMessage ¶
func (*Number) ProtoMessage()
func (*Number) ProtoReflect ¶
func (x *Number) ProtoReflect() protoreflect.Message
type Numbers ¶
type Numbers struct { Values []float64 `protobuf:"fixed64,1,rep,packed,name=Values,proto3" json:"Values,omitempty"` // contains filtered or unexported fields }
func (*Numbers) Descriptor
deprecated
func (*Numbers) ProtoMessage ¶
func (*Numbers) ProtoMessage()
func (*Numbers) ProtoReflect ¶
func (x *Numbers) ProtoReflect() protoreflect.Message
type UnimplementedCalculatorServer ¶
type UnimplementedCalculatorServer struct { }
UnimplementedCalculatorServer must be embedded to have forward compatible implementations.
func (*UnimplementedCalculatorServer) AddStream ¶
func (*UnimplementedCalculatorServer) AddStream(Calculator_AddStreamServer) error
func (*UnimplementedCalculatorServer) DivideStream ¶
func (*UnimplementedCalculatorServer) DivideStream(Calculator_DivideStreamServer) error
func (*UnimplementedCalculatorServer) MultiplyStream ¶
func (*UnimplementedCalculatorServer) MultiplyStream(Calculator_MultiplyStreamServer) error
func (*UnimplementedCalculatorServer) SubtractStream ¶
func (*UnimplementedCalculatorServer) SubtractStream(Calculator_SubtractStreamServer) error
Click to show internal directories.
Click to hide internal directories.