service

package
v0.0.0-...-6a8978f Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 4 Imported by: 0

README

cd service目录下

protoc -I=. --go_out=. --go_opt=module="gitee.com/go-course/go8/micro/rpc/rpc_protobuf/service" pb/hello.proto

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pb_hello_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type HelloService

type HelloService interface {
	Greet(*Request, *Response) error
}

通过这个接口约束客户端的调用和服务端的实现 只要该接口公开, 是不是对于client 就完全知道该如何使用该RPC client.Greet("alice", &resp) 发送的数据结构就是实现了Protobuf编解码的对象

type Request

type Request struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetValue

func (x *Request) GetValue() 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 {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetValue

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

Jump to

Keyboard shortcuts

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