common

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ID_name = map[int32]string{
		0: "_",
		1: "FooReqID",
		2: "FooRespID",
	}
	ID_value = map[string]int32{
		"_":         0,
		"FooReqID":  1,
		"FooRespID": 2,
	}
)

Enum value maps for ID.

View Source
var File_message_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CustomPacker

type CustomPacker struct{}

CustomPacker treats packet as:

totalSize(4)|id(4)|data(n)

| segment | type | size | remark | | ----------- | ------ | ------- | --------------------- | | `totalSize` | uint32 | 4 | the whole packet size | | `id` | uint32 | 4 | | | `data` | []byte | dynamic | |

func (*CustomPacker) Pack

func (p *CustomPacker) Pack(msg *easytcp.Message) ([]byte, error)

func (*CustomPacker) Unpack

func (p *CustomPacker) Unpack(reader io.Reader) (*easytcp.Message, error)

type FooReq

type FooReq struct {
	Bar string `protobuf:"bytes,1,opt,name=Bar,proto3" json:"Bar,omitempty"`
	Buz int32  `protobuf:"varint,2,opt,name=Buz,proto3" json:"Buz,omitempty"`
	// contains filtered or unexported fields
}

func (*FooReq) Descriptor deprecated

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

Deprecated: Use FooReq.ProtoReflect.Descriptor instead.

func (*FooReq) GetBar

func (x *FooReq) GetBar() string

func (*FooReq) GetBuz

func (x *FooReq) GetBuz() int32

func (*FooReq) ProtoMessage

func (*FooReq) ProtoMessage()

func (*FooReq) ProtoReflect

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

func (*FooReq) Reset

func (x *FooReq) Reset()

func (*FooReq) String

func (x *FooReq) String() string

type FooResp

type FooResp struct {
	Code    int32  `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"`
	// contains filtered or unexported fields
}

func (*FooResp) Descriptor deprecated

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

Deprecated: Use FooResp.ProtoReflect.Descriptor instead.

func (*FooResp) GetCode

func (x *FooResp) GetCode() int32

func (*FooResp) GetMessage

func (x *FooResp) GetMessage() string

func (*FooResp) ProtoMessage

func (*FooResp) ProtoMessage()

func (*FooResp) ProtoReflect

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

func (*FooResp) Reset

func (x *FooResp) Reset()

func (*FooResp) String

func (x *FooResp) String() string

type ID

type ID int32
const (
	ID__         ID = 0
	ID_FooReqID  ID = 1
	ID_FooRespID ID = 2
)

func (ID) Descriptor

func (ID) Descriptor() protoreflect.EnumDescriptor

func (ID) Enum

func (x ID) Enum() *ID

func (ID) EnumDescriptor deprecated

func (ID) EnumDescriptor() ([]byte, []int)

Deprecated: Use ID.Descriptor instead.

func (ID) Number

func (x ID) Number() protoreflect.EnumNumber

func (ID) String

func (x ID) String() string

func (ID) Type

func (ID) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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