pb

package
v0.0.0-...-1a196e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2017 License: MIT Imports: 5 Imported by: 0

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) Descriptor() ([]byte, []int)

func (*CalcReply) GetResult

func (m *CalcReply) GetResult() int32

func (*CalcReply) ProtoMessage

func (*CalcReply) ProtoMessage()

func (*CalcReply) Reset

func (m *CalcReply) Reset()

func (*CalcReply) String

func (m *CalcReply) String() string

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL