proto

package
v0.0.0-...-d08609b Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHelloServer

func RegisterHelloServer(s *grpc.Server, srv HelloServer)

Types

type HelloClient

type HelloClient interface {
	//定义服务中的方法
	SayHello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*HelloRep, error)
	CallHello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*HelloRep, error)
}

HelloClient is the client API for Hello service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewHelloClient

func NewHelloClient(cc *grpc.ClientConn) HelloClient

type HelloRep

type HelloRep struct {
	Rep                  string   `protobuf:"bytes,1,opt,name=rep,proto3" json:"rep,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

响应message

func (*HelloRep) Descriptor

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

func (*HelloRep) GetRep

func (m *HelloRep) GetRep() string

func (*HelloRep) ProtoMessage

func (*HelloRep) ProtoMessage()

func (*HelloRep) Reset

func (m *HelloRep) Reset()

func (*HelloRep) String

func (m *HelloRep) String() string

func (*HelloRep) XXX_DiscardUnknown

func (m *HelloRep) XXX_DiscardUnknown()

func (*HelloRep) XXX_Marshal

func (m *HelloRep) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloRep) XXX_Merge

func (m *HelloRep) XXX_Merge(src proto.Message)

func (*HelloRep) XXX_Size

func (m *HelloRep) XXX_Size() int

func (*HelloRep) XXX_Unmarshal

func (m *HelloRep) XXX_Unmarshal(b []byte) error

type HelloReq

type HelloReq struct {
	Req                  string   `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

请求message

func (*HelloReq) Descriptor

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

func (*HelloReq) GetReq

func (m *HelloReq) GetReq() string

func (*HelloReq) ProtoMessage

func (*HelloReq) ProtoMessage()

func (*HelloReq) Reset

func (m *HelloReq) Reset()

func (*HelloReq) String

func (m *HelloReq) String() string

func (*HelloReq) XXX_DiscardUnknown

func (m *HelloReq) XXX_DiscardUnknown()

func (*HelloReq) XXX_Marshal

func (m *HelloReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HelloReq) XXX_Merge

func (m *HelloReq) XXX_Merge(src proto.Message)

func (*HelloReq) XXX_Size

func (m *HelloReq) XXX_Size() int

func (*HelloReq) XXX_Unmarshal

func (m *HelloReq) XXX_Unmarshal(b []byte) error

type HelloServer

type HelloServer interface {
	//定义服务中的方法
	SayHello(context.Context, *HelloReq) (*HelloRep, error)
	CallHello(context.Context, *HelloReq) (*HelloRep, error)
}

HelloServer is the server API for Hello service.

type UnimplementedHelloServer

type UnimplementedHelloServer struct {
}

UnimplementedHelloServer can be embedded to have forward compatible implementations.

func (*UnimplementedHelloServer) CallHello

func (*UnimplementedHelloServer) CallHello(ctx context.Context, req *HelloReq) (*HelloRep, error)

func (*UnimplementedHelloServer) SayHello

Jump to

Keyboard shortcuts

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