Documentation ¶
Index ¶
- Variables
- func RegisterMicroServiceServer(s *grpc.Server, srv MicroServiceServer)
- type MessageHeader
- func (*MessageHeader) Descriptor() ([]byte, []int)deprecated
- func (x *MessageHeader) GetAddress() string
- func (x *MessageHeader) GetClientid() string
- func (x *MessageHeader) GetId() string
- func (x *MessageHeader) GetPort() uint32
- func (x *MessageHeader) GetTimestamp() uint64
- func (*MessageHeader) ProtoMessage()
- func (x *MessageHeader) ProtoReflect() protoreflect.Message
- func (x *MessageHeader) Reset()
- func (x *MessageHeader) String() string
- type MicroServiceClient
- type MicroServiceServer
- type MicroService_GetStreamClient
- type MicroService_GetStreamServer
- type ProtoRequest
- func (*ProtoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ProtoRequest) GetBody() []byte
- func (x *ProtoRequest) GetHeader() *MessageHeader
- func (*ProtoRequest) ProtoMessage()
- func (x *ProtoRequest) ProtoReflect() protoreflect.Message
- func (x *ProtoRequest) Reset()
- func (x *ProtoRequest) String() string
- type ProtoResponse
- func (*ProtoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ProtoResponse) GetBodys() [][]byte
- func (x *ProtoResponse) GetHeader() *MessageHeader
- func (*ProtoResponse) ProtoMessage()
- func (x *ProtoResponse) ProtoReflect() protoreflect.Message
- func (x *ProtoResponse) Reset()
- func (x *ProtoResponse) String() string
- type StreamReqData
- func (*StreamReqData) Descriptor() ([]byte, []int)deprecated
- func (x *StreamReqData) GetBody() []byte
- func (x *StreamReqData) GetHeader() *MessageHeader
- func (*StreamReqData) ProtoMessage()
- func (x *StreamReqData) ProtoReflect() protoreflect.Message
- func (x *StreamReqData) Reset()
- func (x *StreamReqData) String() string
- type StreamResData
- func (*StreamResData) Descriptor() ([]byte, []int)deprecated
- func (x *StreamResData) GetBodys() [][]byte
- func (x *StreamResData) GetHeader() *MessageHeader
- func (*StreamResData) ProtoMessage()
- func (x *StreamResData) ProtoReflect() protoreflect.Message
- func (x *StreamResData) Reset()
- func (x *StreamResData) String() string
- type UnimplementedMicroServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_microApp_proto protoreflect.FileDescriptor
Functions ¶
func RegisterMicroServiceServer ¶
func RegisterMicroServiceServer(s *grpc.Server, srv MicroServiceServer)
Types ¶
type MessageHeader ¶
type MessageHeader struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 动作ID Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 请求时间戳 Clientid string `protobuf:"bytes,3,opt,name=clientid,proto3" json:"clientid,omitempty"` // 请求标识 Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` // 远程地址 Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` // 远程端口 // contains filtered or unexported fields }
消息头
func (*MessageHeader) Descriptor
deprecated
func (*MessageHeader) Descriptor() ([]byte, []int)
Deprecated: Use MessageHeader.ProtoReflect.Descriptor instead.
func (*MessageHeader) GetAddress ¶
func (x *MessageHeader) GetAddress() string
func (*MessageHeader) GetClientid ¶
func (x *MessageHeader) GetClientid() string
func (*MessageHeader) GetId ¶
func (x *MessageHeader) GetId() string
func (*MessageHeader) GetPort ¶
func (x *MessageHeader) GetPort() uint32
func (*MessageHeader) GetTimestamp ¶
func (x *MessageHeader) GetTimestamp() uint64
func (*MessageHeader) ProtoMessage ¶
func (*MessageHeader) ProtoMessage()
func (*MessageHeader) ProtoReflect ¶
func (x *MessageHeader) ProtoReflect() protoreflect.Message
func (*MessageHeader) Reset ¶
func (x *MessageHeader) Reset()
func (*MessageHeader) String ¶
func (x *MessageHeader) String() string
type MicroServiceClient ¶
type MicroServiceClient interface { // "请求-回复"模式 ReqRep(ctx context.Context, in *ProtoRequest, opts ...grpc.CallOption) (*ProtoResponse, error) // 服务器向客户端发送流数据 GetStream(ctx context.Context, opts ...grpc.CallOption) (MicroService_GetStreamClient, error) }
MicroServiceClient is the client API for MicroService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMicroServiceClient ¶
func NewMicroServiceClient(cc grpc.ClientConnInterface) MicroServiceClient
type MicroServiceServer ¶
type MicroServiceServer interface { // "请求-回复"模式 ReqRep(context.Context, *ProtoRequest) (*ProtoResponse, error) // 服务器向客户端发送流数据 GetStream(MicroService_GetStreamServer) error }
MicroServiceServer is the server API for MicroService service.
type MicroService_GetStreamClient ¶
type MicroService_GetStreamClient interface { Send(*StreamReqData) error Recv() (*StreamResData, error) grpc.ClientStream }
type MicroService_GetStreamServer ¶
type MicroService_GetStreamServer interface { Send(*StreamResData) error Recv() (*StreamReqData, error) grpc.ServerStream }
type ProtoRequest ¶
type ProtoRequest struct { Header *MessageHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // 消息头 Body []byte `protobuf:"bytes,8,opt,name=body,proto3" json:"body,omitempty"` // 请求数据 // contains filtered or unexported fields }
请求
func (*ProtoRequest) Descriptor
deprecated
func (*ProtoRequest) Descriptor() ([]byte, []int)
Deprecated: Use ProtoRequest.ProtoReflect.Descriptor instead.
func (*ProtoRequest) GetBody ¶
func (x *ProtoRequest) GetBody() []byte
func (*ProtoRequest) GetHeader ¶
func (x *ProtoRequest) GetHeader() *MessageHeader
func (*ProtoRequest) ProtoMessage ¶
func (*ProtoRequest) ProtoMessage()
func (*ProtoRequest) ProtoReflect ¶
func (x *ProtoRequest) ProtoReflect() protoreflect.Message
func (*ProtoRequest) Reset ¶
func (x *ProtoRequest) Reset()
func (*ProtoRequest) String ¶
func (x *ProtoRequest) String() string
type ProtoResponse ¶
type ProtoResponse struct { Header *MessageHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // 消息头 Bodys [][]byte `protobuf:"bytes,8,rep,name=bodys,proto3" json:"bodys,omitempty"` // 响应的数据集 // contains filtered or unexported fields }
响应
func (*ProtoResponse) Descriptor
deprecated
func (*ProtoResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProtoResponse.ProtoReflect.Descriptor instead.
func (*ProtoResponse) GetBodys ¶
func (x *ProtoResponse) GetBodys() [][]byte
func (*ProtoResponse) GetHeader ¶
func (x *ProtoResponse) GetHeader() *MessageHeader
func (*ProtoResponse) ProtoMessage ¶
func (*ProtoResponse) ProtoMessage()
func (*ProtoResponse) ProtoReflect ¶
func (x *ProtoResponse) ProtoReflect() protoreflect.Message
func (*ProtoResponse) Reset ¶
func (x *ProtoResponse) Reset()
func (*ProtoResponse) String ¶
func (x *ProtoResponse) String() string
type StreamReqData ¶
type StreamReqData struct { Header *MessageHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` Body []byte `protobuf:"bytes,8,opt,name=body,proto3" json:"body,omitempty"` // 请求数据 // contains filtered or unexported fields }
流数据
func (*StreamReqData) Descriptor
deprecated
func (*StreamReqData) Descriptor() ([]byte, []int)
Deprecated: Use StreamReqData.ProtoReflect.Descriptor instead.
func (*StreamReqData) GetBody ¶
func (x *StreamReqData) GetBody() []byte
func (*StreamReqData) GetHeader ¶
func (x *StreamReqData) GetHeader() *MessageHeader
func (*StreamReqData) ProtoMessage ¶
func (*StreamReqData) ProtoMessage()
func (*StreamReqData) ProtoReflect ¶
func (x *StreamReqData) ProtoReflect() protoreflect.Message
func (*StreamReqData) Reset ¶
func (x *StreamReqData) Reset()
func (*StreamReqData) String ¶
func (x *StreamReqData) String() string
type StreamResData ¶
type StreamResData struct { Header *MessageHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // 消息头 Bodys [][]byte `protobuf:"bytes,8,rep,name=bodys,proto3" json:"bodys,omitempty"` // 响应的数据集 // contains filtered or unexported fields }
流数据
func (*StreamResData) Descriptor
deprecated
func (*StreamResData) Descriptor() ([]byte, []int)
Deprecated: Use StreamResData.ProtoReflect.Descriptor instead.
func (*StreamResData) GetBodys ¶
func (x *StreamResData) GetBodys() [][]byte
func (*StreamResData) GetHeader ¶
func (x *StreamResData) GetHeader() *MessageHeader
func (*StreamResData) ProtoMessage ¶
func (*StreamResData) ProtoMessage()
func (*StreamResData) ProtoReflect ¶
func (x *StreamResData) ProtoReflect() protoreflect.Message
func (*StreamResData) Reset ¶
func (x *StreamResData) Reset()
func (*StreamResData) String ¶
func (x *StreamResData) String() string
type UnimplementedMicroServiceServer ¶
type UnimplementedMicroServiceServer struct { }
UnimplementedMicroServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedMicroServiceServer) GetStream ¶
func (*UnimplementedMicroServiceServer) GetStream(MicroService_GetStreamServer) error
func (*UnimplementedMicroServiceServer) ReqRep ¶
func (*UnimplementedMicroServiceServer) ReqRep(context.Context, *ProtoRequest) (*ProtoResponse, error)