Documentation
¶
Overview ¶
Package signal is a generated protocol buffer package.
It is generated from these files:
signal.proto
It has these top-level messages:
Signal Header
Index ¶
- type Engine
- type Handler
- type Header
- type Signal
- func (*Signal) Descriptor() ([]byte, []int)
- func (m *Signal) GetData() []byte
- func (m *Signal) GetHeaders() *Header
- func (m *Signal) GetSequence() int64
- func (m *Signal) GetSignal() uint32
- func (m *Signal) GetVersion() uint32
- func (*Signal) ProtoMessage()
- func (m *Signal) Reset()
- func (m *Signal) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface { RegisterSignal(signalCode uint32, handler Handler) error AddListen(name string, listen netx.ContextListen) Connection(addr *net.TCPAddr) error Bind(addr *net.TCPAddr) (netx.Server, error) Close() GetBootStrap() netx.Bootstrap }
Engine 信令处理引擎
type Handler ¶
type Handler interface { //处理信令 Handle(context netx.ConnContext, signal *Signal) }
Handler 信令处理接口
type Header ¶
type Header struct { // 头定义 Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` // 值 Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` }
Header 信令头定义
func (*Header) Descriptor ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
type Signal ¶
type Signal struct { // 信令值,uint32 Signal uint32 `protobuf:"varint,1,opt,name=signal" json:"signal,omitempty"` // 序列号 Sequence int64 `protobuf:"varint,2,opt,name=sequence" json:"sequence,omitempty"` // 版本号 Version uint32 `protobuf:"varint,3,opt,name=version" json:"version,omitempty"` // 信令头扩展 Headers *Header `protobuf:"bytes,4,opt,name=headers" json:"headers,omitempty"` // 信令内容 Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` }
Signal 信令结构定义
func NewSimpleSignal ¶
NewSimpleSignal 创建一个低级别的 Signal
func (*Signal) Descriptor ¶
func (*Signal) GetHeaders ¶
func (*Signal) GetSequence ¶
func (*Signal) GetVersion ¶
func (*Signal) ProtoMessage ¶
func (*Signal) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.