protocol

package
v0.0.0-...-4b52c34 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BurstType_name = map[int32]string{
	0: "INIT",
	1: "CLOSE",
	2: "USER_CONNECT",
	3: "FORWARD_DATA",
}
View Source
var BurstType_value = map[string]int32{
	"INIT":         0,
	"CLOSE":        1,
	"USER_CONNECT": 2,
	"FORWARD_DATA": 3,
}
View Source
var Headers_name = map[int32]string{
	0: "ERROR",
	1: "PORTS",
	2: "SERVER_EXPORT_PORT",
	3: "USER_CONNECT_ID",
}
View Source
var Headers_value = map[string]int32{
	"ERROR":              0,
	"PORTS":              1,
	"SERVER_EXPORT_PORT": 2,
	"USER_CONNECT_ID":    3,
}
View Source
var NotFound = errors.New("not found")

Functions

func Encode

func Encode(userConnectIdStr string, data []byte) []byte

func GetError

func GetError(message *BurstMessage) error

func GetServerExportPort

func GetServerExportPort(message *BurstMessage) (int32, error)

func GetUserConnectId

func GetUserConnectId(message *BurstMessage) (string, error)

Types

type BurstMessage

type BurstMessage struct {
	Type                 BurstType          `protobuf:"varint,1,opt,name=type,proto3,enum=protocol.BurstType" json:"type,omitempty"`
	Header               map[int32]*any.Any `` /* 154-byte string literal not displayed */
	Data                 []byte             `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func Decode

func Decode(data []byte) (*BurstMessage, error)

func (*BurstMessage) Descriptor

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

func (*BurstMessage) GetData

func (m *BurstMessage) GetData() []byte

func (*BurstMessage) GetHeader

func (m *BurstMessage) GetHeader() map[int32]*any.Any

func (*BurstMessage) GetType

func (m *BurstMessage) GetType() BurstType

func (*BurstMessage) ProtoMessage

func (*BurstMessage) ProtoMessage()

func (*BurstMessage) Reset

func (m *BurstMessage) Reset()

func (*BurstMessage) String

func (m *BurstMessage) String() string

func (*BurstMessage) XXX_DiscardUnknown

func (m *BurstMessage) XXX_DiscardUnknown()

func (*BurstMessage) XXX_Marshal

func (m *BurstMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BurstMessage) XXX_Merge

func (m *BurstMessage) XXX_Merge(src proto.Message)

func (*BurstMessage) XXX_Size

func (m *BurstMessage) XXX_Size() int

func (*BurstMessage) XXX_Unmarshal

func (m *BurstMessage) XXX_Unmarshal(b []byte) error

type BurstType

type BurstType int32
const (
	// 初始化
	BurstType_INIT BurstType = 0
	// 关闭
	BurstType_CLOSE BurstType = 1
	// 客户连接
	BurstType_USER_CONNECT BurstType = 2
	// 转发数据
	BurstType_FORWARD_DATA BurstType = 3
)

func (BurstType) EnumDescriptor

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

func (BurstType) String

func (x BurstType) String() string

type Headers

type Headers int32
const (
	// 错误信息 string
	Headers_ERROR Headers = 0
	// port mapping Map<int,int>
	Headers_PORTS Headers = 1
	// 服务端暴露的端口 int32
	Headers_SERVER_EXPORT_PORT Headers = 2
	// 外网客户的id string
	Headers_USER_CONNECT_ID Headers = 3
)

func (Headers) EnumDescriptor

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

func (Headers) String

func (x Headers) String() string

type Ports

type Ports struct {
	Ports                map[int32]int32 `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func GetPorts

func GetPorts(message *BurstMessage) (*Ports, error)

func (*Ports) Descriptor

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

func (*Ports) GetPorts

func (m *Ports) GetPorts() map[int32]int32

func (*Ports) ProtoMessage

func (*Ports) ProtoMessage()

func (*Ports) Reset

func (m *Ports) Reset()

func (*Ports) String

func (m *Ports) String() string

func (*Ports) XXX_DiscardUnknown

func (m *Ports) XXX_DiscardUnknown()

func (*Ports) XXX_Marshal

func (m *Ports) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Ports) XXX_Merge

func (m *Ports) XXX_Merge(src proto.Message)

func (*Ports) XXX_Size

func (m *Ports) XXX_Size() int

func (*Ports) XXX_Unmarshal

func (m *Ports) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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