protocol

package
v0.0.0-...-b8a7096 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 6 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var File_api_protocol_protocol_proto protoreflect.FileDescriptor

Functions

func ReleaseReply

func ReleaseReply(reply *Reply)

ReleaseReply release Reply

func ReleaseRequest

func ReleaseRequest(req *Request)

ReleaseRequest release Request

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 AcquireReply

func AcquireReply() *Reply

AcquireReply get Reply

func (*Reply) Descriptor deprecated

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

Deprecated: Use Reply.ProtoReflect.Descriptor instead.

func (*Reply) GetData

func (x *Reply) GetData() []byte

func (*Reply) GetId

func (x *Reply) GetId() string

func (*Reply) GetMetadata

func (x *Reply) GetMetadata() map[string]string

func (*Reply) GetOperation

func (x *Reply) GetOperation() string

func (*Reply) GetStatus

func (x *Reply) GetStatus() *status.Status

func (*Reply) ProtoMessage

func (*Reply) ProtoMessage()

func (*Reply) ProtoReflect

func (x *Reply) ProtoReflect() protoreflect.Message

func (*Reply) Reset

func (x *Reply) Reset()

func (*Reply) String

func (x *Reply) String() string

func (*Reply) WithMetadata

func (r *Reply) WithMetadata(metadata map[string]string) *Reply

WithMetadata setting metadata

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 AcquireRequest

func AcquireRequest() *Request

AcquireRequest get Request

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetData

func (x *Request) GetData() []byte

func (*Request) GetId

func (x *Request) GetId() string

func (*Request) GetMetadata

func (x *Request) GetMetadata() map[string]string

func (*Request) GetOperation

func (x *Request) GetOperation() 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

Jump to

Keyboard shortcuts

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