Documentation
¶
Index ¶
- Variables
- func RegisterStudentServiceServer(s *grpc.Server, srv StudentServiceServer)
- type Request
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetGoodAt() []string
- func (x *Response) GetGrade() 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 StudentServiceClient
- type StudentServiceServer
- type UnimplementedStudentServiceServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_student_proto protoreflect.FileDescriptor
Functions ¶
func RegisterStudentServiceServer ¶
func RegisterStudentServiceServer(s *grpc.Server, srv StudentServiceServer)
Types ¶
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"`
Grade string `protobuf:"bytes,3,opt,name=grade,proto3" json:"grade,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 StudentServiceClient ¶
type StudentServiceClient interface {
// rpc 定义服务内的 GetStudentInfo 远程调用
GetStudentInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
StudentServiceClient is the client API for StudentService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewStudentServiceClient ¶
func NewStudentServiceClient(cc grpc.ClientConnInterface) StudentServiceClient
type StudentServiceServer ¶
type StudentServiceServer interface {
// rpc 定义服务内的 GetStudentInfo 远程调用
GetStudentInfo(context.Context, *Request) (*Response, error)
}
StudentServiceServer is the server API for StudentService service.
type UnimplementedStudentServiceServer ¶
type UnimplementedStudentServiceServer struct {
}
UnimplementedStudentServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedStudentServiceServer) GetStudentInfo ¶
Click to show internal directories.
Click to hide internal directories.