Documentation ¶
Overview ¶
Package protocol MIT License
# Copyright (c) 2024 go-fox Author https://github.com/go-fox/fox
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Variables
- func ReleaseReply(reply *Reply)
- func ReleaseRequest(req *Request)
- type Reply
- func (*Reply) Descriptor() ([]byte, []int)deprecated
- func (x *Reply) GetData() []byte
- func (x *Reply) GetId() string
- func (x *Reply) GetMetadata() map[string]string
- func (x *Reply) GetOperation() string
- func (x *Reply) GetStatus() *status.Status
- func (*Reply) ProtoMessage()
- func (x *Reply) ProtoReflect() protoreflect.Message
- func (x *Reply) Reset()
- func (x *Reply) String() string
- func (r *Reply) WithMetadata(metadata map[string]string) *Reply
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetData() []byte
- func (x *Request) GetId() string
- func (x *Request) GetMetadata() map[string]string
- func (x *Request) GetOperation() string
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
Constants ¶
This section is empty.
Variables ¶
var File_api_protocol_protocol_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Reply ¶
type Reply struct { // 请求唯一标识,request提交,服务直接返回 Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 当前回复对应的操作 Operation string `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"` // 服务器下发的元数据 Metadata map[string]string `` /* 157-byte string literal not displayed */ // 回复的真实数据 Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // 状态信息 Status *status.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
Reply 回复数据
func (*Reply) Descriptor
deprecated
func (*Reply) GetMetadata ¶
func (*Reply) GetOperation ¶
func (*Reply) ProtoMessage ¶
func (*Reply) ProtoMessage()
func (*Reply) ProtoReflect ¶
func (x *Reply) ProtoReflect() protoreflect.Message
type Request ¶
type Request struct { // 请求唯一标识 Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // protobuf生成的服务完整方法选择器 Operation string `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"` // 附带元数据 Metadata map[string]string `` /* 157-byte string literal not displayed */ // 传递的真实数据 Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
Request 上行数据
func (*Request) Descriptor
deprecated
func (*Request) GetMetadata ¶
func (*Request) GetOperation ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message