proto

package
v0.0.0-...-0f051d9 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetName

func (x *Request) GetName() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetGoodAt

func (x *Response) GetGoodAt() []string

func (*Response) GetGrade

func (x *Response) GetGrade() string

func (*Response) GetUid

func (x *Response) GetUid() int32

func (*Response) GetUsername

func (x *Response) GetUsername() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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.

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

Jump to

Keyboard shortcuts

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