proto

package
v0.0.0-...-d555923 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 8 Imported by: 7

Documentation

Index

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.

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetGoodAt

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

func (*Response) GetJob

func (x *Response) GetJob() 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 UnimplementedProgrammerServiceServer

type UnimplementedProgrammerServiceServer struct {
}

UnimplementedProgrammerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedProgrammerServiceServer) GetProgrammerInfo

Jump to

Keyboard shortcuts

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