Documentation ¶
Index ¶
- Variables
- func RegisterGreeterSimpleServer(s *grpc.Server, srv GreeterSimpleServer)
- type GreeterSimpleClient
- type GreeterSimpleServer
- type SimpleRequest
- type SimpleResponse
- func (*SimpleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SimpleResponse) GetCode() int32
- func (x *SimpleResponse) GetValue() string
- func (*SimpleResponse) ProtoMessage()
- func (x *SimpleResponse) ProtoReflect() protoreflect.Message
- func (x *SimpleResponse) Reset()
- func (x *SimpleResponse) String() string
- type UnimplementedGreeterSimpleServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_simple_proto protoreflect.FileDescriptor
Functions ¶
func RegisterGreeterSimpleServer ¶
func RegisterGreeterSimpleServer(s *grpc.Server, srv GreeterSimpleServer)
Types ¶
type GreeterSimpleClient ¶
type GreeterSimpleClient interface {
Route(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error)
}
GreeterSimpleClient is the client API for GreeterSimple service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGreeterSimpleClient ¶
func NewGreeterSimpleClient(cc grpc.ClientConnInterface) GreeterSimpleClient
type GreeterSimpleServer ¶
type GreeterSimpleServer interface {
Route(context.Context, *SimpleRequest) (*SimpleResponse, error)
}
GreeterSimpleServer is the server API for GreeterSimple service.
type SimpleRequest ¶
type SimpleRequest struct { // 定义发送的参数 // 参数类型 参数名 标识号(不可重复) Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
定义发送请求信息
func (*SimpleRequest) Descriptor
deprecated
func (*SimpleRequest) Descriptor() ([]byte, []int)
Deprecated: Use SimpleRequest.ProtoReflect.Descriptor instead.
func (*SimpleRequest) GetData ¶
func (x *SimpleRequest) GetData() string
func (*SimpleRequest) ProtoMessage ¶
func (*SimpleRequest) ProtoMessage()
func (*SimpleRequest) ProtoReflect ¶
func (x *SimpleRequest) ProtoReflect() protoreflect.Message
func (*SimpleRequest) Reset ¶
func (x *SimpleRequest) Reset()
func (*SimpleRequest) String ¶
func (x *SimpleRequest) String() string
type SimpleResponse ¶
type SimpleResponse struct { // 定义接收的参数 // 参数类型 参数名 标识号(不可重复) Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
定义响应信息
func (*SimpleResponse) Descriptor
deprecated
func (*SimpleResponse) Descriptor() ([]byte, []int)
Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead.
func (*SimpleResponse) GetCode ¶
func (x *SimpleResponse) GetCode() int32
func (*SimpleResponse) GetValue ¶
func (x *SimpleResponse) GetValue() string
func (*SimpleResponse) ProtoMessage ¶
func (*SimpleResponse) ProtoMessage()
func (*SimpleResponse) ProtoReflect ¶
func (x *SimpleResponse) ProtoReflect() protoreflect.Message
func (*SimpleResponse) Reset ¶
func (x *SimpleResponse) Reset()
func (*SimpleResponse) String ¶
func (x *SimpleResponse) String() string
type UnimplementedGreeterSimpleServer ¶
type UnimplementedGreeterSimpleServer struct { }
UnimplementedGreeterSimpleServer can be embedded to have forward compatible implementations.
func (*UnimplementedGreeterSimpleServer) Route ¶
func (*UnimplementedGreeterSimpleServer) Route(context.Context, *SimpleRequest) (*SimpleResponse, error)
Click to show internal directories.
Click to hide internal directories.