Documentation ¶
Index ¶
- Variables
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetChainId() string
- func (m *Message) GetFlag() string
- func (m *Message) GetMessage() *NetMessage
- func (m *Message) Marshal() (dAtA []byte, err error)
- func (m *Message) MarshalTo(dAtA []byte) (int, error)
- func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) Size() (n int)
- func (m *Message) String() string
- func (m *Message) Unmarshal(dAtA []byte) error
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type NetMessage
- func (*NetMessage) Descriptor() ([]byte, []int)
- func (m *NetMessage) GetPayload() []byte
- func (m *NetMessage) GetTo() string
- func (m *NetMessage) GetType() NetMessage_MessageType
- func (m *NetMessage) Marshal() (dAtA []byte, err error)
- func (m *NetMessage) MarshalTo(dAtA []byte) (int, error)
- func (m *NetMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*NetMessage) ProtoMessage()
- func (m *NetMessage) Reset()
- func (m *NetMessage) Size() (n int)
- func (m *NetMessage) String() string
- func (m *NetMessage) Unmarshal(dAtA []byte) error
- func (m *NetMessage) XXX_DiscardUnknown()
- func (m *NetMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NetMessage) XXX_Merge(src proto.Message)
- func (m *NetMessage) XXX_Size() int
- func (m *NetMessage) XXX_Unmarshal(b []byte) error
- type NetMessage_MessageType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthNet = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowNet = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupNet = fmt.Errorf("proto: unexpected end of group") )
View Source
var NetMessage_MessageType_name = map[int32]string{
0: "INVALID_MESSAGE",
1: "TX",
2: "TXS",
3: "BLOCK",
4: "BLOCKS",
5: "CONSENSUS",
6: "SYNC_BLOCK_MESSAGE",
}
View Source
var NetMessage_MessageType_value = map[string]int32{
"INVALID_MESSAGE": 0,
"TX": 1,
"TXS": 2,
"BLOCK": 3,
"BLOCKS": 4,
"CONSENSUS": 5,
"SYNC_BLOCK_MESSAGE": 6,
}
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Message *NetMessage `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // 属于那个模块,判断消息类型 Flag string `protobuf:"bytes,3,opt,name=flag,proto3" json:"flag,omitempty"` }
包装的网络消息
func (*Message) Descriptor ¶
func (*Message) GetChainId ¶
func (*Message) GetMessage ¶
func (m *Message) GetMessage() *NetMessage
func (*Message) MarshalToSizedBuffer ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
type NetMessage ¶
type NetMessage struct { // 有效数据 Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` // 消息类型 Type NetMessage_MessageType `protobuf:"varint,2,opt,name=type,proto3,enum=net.NetMessage_MessageType" json:"type,omitempty"` // node id To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` }
网络消息
func (*NetMessage) Descriptor ¶
func (*NetMessage) Descriptor() ([]byte, []int)
func (*NetMessage) GetPayload ¶
func (m *NetMessage) GetPayload() []byte
func (*NetMessage) GetTo ¶
func (m *NetMessage) GetTo() string
func (*NetMessage) GetType ¶
func (m *NetMessage) GetType() NetMessage_MessageType
func (*NetMessage) Marshal ¶
func (m *NetMessage) Marshal() (dAtA []byte, err error)
func (*NetMessage) MarshalToSizedBuffer ¶
func (m *NetMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*NetMessage) ProtoMessage ¶
func (*NetMessage) ProtoMessage()
func (*NetMessage) Reset ¶
func (m *NetMessage) Reset()
func (*NetMessage) Size ¶
func (m *NetMessage) Size() (n int)
func (*NetMessage) String ¶
func (m *NetMessage) String() string
func (*NetMessage) Unmarshal ¶
func (m *NetMessage) Unmarshal(dAtA []byte) error
func (*NetMessage) XXX_DiscardUnknown ¶
func (m *NetMessage) XXX_DiscardUnknown()
func (*NetMessage) XXX_Marshal ¶
func (m *NetMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NetMessage) XXX_Merge ¶
func (m *NetMessage) XXX_Merge(src proto.Message)
func (*NetMessage) XXX_Size ¶
func (m *NetMessage) XXX_Size() int
func (*NetMessage) XXX_Unmarshal ¶
func (m *NetMessage) XXX_Unmarshal(b []byte) error
type NetMessage_MessageType ¶
type NetMessage_MessageType int32
特定的网络消息类型
const ( NetMessage_INVALID_MESSAGE NetMessage_MessageType = 0 NetMessage_TX NetMessage_MessageType = 1 NetMessage_TXS NetMessage_MessageType = 2 NetMessage_BLOCK NetMessage_MessageType = 3 NetMessage_BLOCKS NetMessage_MessageType = 4 NetMessage_CONSENSUS NetMessage_MessageType = 5 NetMessage_SYNC_BLOCK_MESSAGE NetMessage_MessageType = 6 )
func (NetMessage_MessageType) EnumDescriptor ¶
func (NetMessage_MessageType) EnumDescriptor() ([]byte, []int)
func (NetMessage_MessageType) String ¶
func (x NetMessage_MessageType) String() string
Click to show internal directories.
Click to hide internal directories.