Documentation ¶
Index ¶
- Variables
- func RegisterProgrammerServiceServer(s *grpc.Server, srv ProgrammerServiceServer)
- type ProgrammerServiceClient
- type ProgrammerServiceServer
- type Request
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetGoodAt() []string
- func (x *Response) GetJob() string
- func (x *Response) GetUid() int32
- func (x *Response) GetUsername() string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type UnimplementedProgrammerServiceServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_programmer_proto protoreflect.FileDescriptor
Functions ¶
func RegisterProgrammerServiceServer ¶
func RegisterProgrammerServiceServer(s *grpc.Server, srv ProgrammerServiceServer)
Types ¶
type ProgrammerServiceClient ¶
type ProgrammerServiceClient interface { // rpc 定义服务内的 GetProgrammerInfo 远程调用 GetProgrammerInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) }
ProgrammerServiceClient is the client API for ProgrammerService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewProgrammerServiceClient ¶
func NewProgrammerServiceClient(cc grpc.ClientConnInterface) ProgrammerServiceClient
type ProgrammerServiceServer ¶
type ProgrammerServiceServer interface { // rpc 定义服务内的 GetProgrammerInfo 远程调用 GetProgrammerInfo(context.Context, *Request) (*Response, error) }
ProgrammerServiceServer is the server API for ProgrammerService service.
type Request ¶
type Request struct { // [修饰符] 类型 字段名 = 标识符; Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Job string `protobuf:"bytes,3,opt,name=job,proto3" json:"job,omitempty"` GoodAt []string `protobuf:"bytes,4,rep,name=goodAt,proto3" json:"goodAt,omitempty"` // repeated 修饰符表示字段是可变数组,即 slice 类型 // contains filtered or unexported fields }
定义服务端响应的数据格式
func (*Response) Descriptor
deprecated
func (*Response) GetUsername ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedProgrammerServiceServer ¶
type UnimplementedProgrammerServiceServer struct { }
UnimplementedProgrammerServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedProgrammerServiceServer) GetProgrammerInfo ¶
Click to show internal directories.
Click to hide internal directories.