Documentation ¶
Index ¶
- Variables
- func RegisterGRPCServer(s *grpc.Server, srv GRPCServer)
- type GRPCClient
- type GRPCServer
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetBody() []byte
- func (x *Request) GetHeader() map[string]string
- func (x *Request) GetMethod() string
- func (x *Request) GetService() string
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- func (x *Response) Body() (bytes []byte, err error)
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetHeader() map[string]stringdeprecated
- func (x *Response) GetResult() (body []byte)deprecated
- func (x *Response) GetStatus() int32deprecated
- func (x *Response) Header() map[string]string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) StatusCode() int
- func (x *Response) String() string
- type UnimplementedGRPCServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_grpc_proto protoreflect.FileDescriptor
Functions ¶
func RegisterGRPCServer ¶
func RegisterGRPCServer(s *grpc.Server, srv GRPCServer)
Types ¶
type GRPCClient ¶
type GRPCClient interface {
Process(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}
GRPCClient is the client API for GRPC service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGRPCClient ¶
func NewGRPCClient(cc grpc.ClientConnInterface) GRPCClient
type GRPCServer ¶
GRPCServer is the server API for GRPC service.
type Request ¶
type Request struct { Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` //服务名称 Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` //请求方法,GET Header map[string]string `` //请求头信息map[string]string /* 153-byte string literal not displayed */ Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` //请求参数 json // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetService ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态码 Headers map[string]string `` //返回头信息,map[string]string /* 153-byte string literal not displayed */ Result []byte `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"` //返回结果,default=json,according to content-type // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
func (*Response) StatusCode ¶ added in v0.5.23
type UnimplementedGRPCServer ¶
type UnimplementedGRPCServer struct { }
UnimplementedGRPCServer can be embedded to have forward compatible implementations.
Click to show internal directories.
Click to hide internal directories.