Documentation ¶
Overview ¶
Package pb is a generated protocol buffer package.
It is generated from these files:
calc.proto
It has these top-level messages:
CalcRequest CalcReply
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCalculatorServer ¶
func RegisterCalculatorServer(s *grpc.Server, srv CalculatorServer)
Types ¶
type CalcReply ¶
type CalcReply struct {
Result int32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"`
}
CalcReply 是計算結果,將會回傳給客戶端。
func (*CalcReply) Descriptor ¶
func (*CalcReply) ProtoMessage ¶
func (*CalcReply) ProtoMessage()
type CalcRequest ¶
type CalcRequest struct { NumberA int32 `protobuf:"varint,1,opt,name=number_a,json=numberA" json:"number_a,omitempty"` NumberB int32 `protobuf:"varint,2,opt,name=number_b,json=numberB" json:"number_b,omitempty"` }
CalcRequest 包含了兩個數字,將會傳送至計算服務並對兩個數字進行計算。
func (*CalcRequest) Descriptor ¶
func (*CalcRequest) Descriptor() ([]byte, []int)
func (*CalcRequest) GetNumberA ¶
func (m *CalcRequest) GetNumberA() int32
func (*CalcRequest) GetNumberB ¶
func (m *CalcRequest) GetNumberB() int32
func (*CalcRequest) ProtoMessage ¶
func (*CalcRequest) ProtoMessage()
func (*CalcRequest) Reset ¶
func (m *CalcRequest) Reset()
func (*CalcRequest) String ¶
func (m *CalcRequest) String() string
type CalculatorClient ¶
type CalculatorClient interface { // Plus 會接收 CalcRequest 資料作加總,最終會回傳 CalcReply。 Plus(ctx context.Context, in *CalcRequest, opts ...grpc.CallOption) (*CalcReply, error) }
func NewCalculatorClient ¶
func NewCalculatorClient(cc *grpc.ClientConn) CalculatorClient
type CalculatorServer ¶
type CalculatorServer interface { // Plus 會接收 CalcRequest 資料作加總,最終會回傳 CalcReply。 Plus(context.Context, *CalcRequest) (*CalcReply, error) }
Click to show internal directories.
Click to hide internal directories.