Documentation ¶
Overview ¶
Package pb is a generated protocol buffer package.
It is generated from these files:
findnode.proto message.proto nodeinfo.proto
It has these top-level messages:
FindNodeReq FindNodeResp CommonMessageData HandshakeData ProtocolMessage Metadata PingReqData PingRespData NodeInfo
Index ¶
- type CommonMessageData
- func (*CommonMessageData) Descriptor() ([]byte, []int)
- func (m *CommonMessageData) GetPayload() []byte
- func (m *CommonMessageData) GetSessionId() []byte
- func (m *CommonMessageData) GetTimestamp() int64
- func (*CommonMessageData) ProtoMessage()
- func (m *CommonMessageData) Reset()
- func (m *CommonMessageData) String() string
- type FindNodeReq
- type FindNodeResp
- type HandshakeData
- func (*HandshakeData) Descriptor() ([]byte, []int)
- func (m *HandshakeData) GetClientVersion() string
- func (m *HandshakeData) GetHmac() []byte
- func (m *HandshakeData) GetIv() []byte
- func (m *HandshakeData) GetNetworkID() int32
- func (m *HandshakeData) GetNodePubKey() []byte
- func (m *HandshakeData) GetPayload() []byte
- func (m *HandshakeData) GetProtocol() string
- func (m *HandshakeData) GetPubKey() []byte
- func (m *HandshakeData) GetSessionId() []byte
- func (m *HandshakeData) GetSign() string
- func (m *HandshakeData) GetTcpAddress() string
- func (m *HandshakeData) GetTimestamp() int64
- func (*HandshakeData) ProtoMessage()
- func (m *HandshakeData) Reset()
- func (m *HandshakeData) String() string
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)
- func (m *Metadata) GetAuthPubKey() []byte
- func (m *Metadata) GetAuthorSign() string
- func (m *Metadata) GetClientVersion() string
- func (m *Metadata) GetGossip() bool
- func (m *Metadata) GetProtocol() string
- func (m *Metadata) GetReqId() []byte
- func (m *Metadata) GetTimestamp() int64
- func (*Metadata) ProtoMessage()
- func (m *Metadata) Reset()
- func (m *Metadata) String() string
- type NodeInfo
- type PingReqData
- type PingRespData
- type ProtocolMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonMessageData ¶
type CommonMessageData struct { SessionId []byte `protobuf:"bytes,1,opt,name=sessionId,proto3" json:"sessionId,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` Timestamp int64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` }
data common to all messages - Top level msg format
func (*CommonMessageData) Descriptor ¶
func (*CommonMessageData) Descriptor() ([]byte, []int)
func (*CommonMessageData) GetPayload ¶
func (m *CommonMessageData) GetPayload() []byte
func (*CommonMessageData) GetSessionId ¶
func (m *CommonMessageData) GetSessionId() []byte
func (*CommonMessageData) GetTimestamp ¶
func (m *CommonMessageData) GetTimestamp() int64
func (*CommonMessageData) ProtoMessage ¶
func (*CommonMessageData) ProtoMessage()
func (*CommonMessageData) Reset ¶
func (m *CommonMessageData) Reset()
func (*CommonMessageData) String ¶
func (m *CommonMessageData) String() string
type FindNodeReq ¶
type FindNodeReq struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` NodeId []byte `protobuf:"bytes,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"` MaxResults int32 `protobuf:"varint,3,opt,name=maxResults" json:"maxResults,omitempty"` }
example protocol
func (*FindNodeReq) Descriptor ¶
func (*FindNodeReq) Descriptor() ([]byte, []int)
func (*FindNodeReq) GetMaxResults ¶
func (m *FindNodeReq) GetMaxResults() int32
func (*FindNodeReq) GetMetadata ¶
func (m *FindNodeReq) GetMetadata() *Metadata
func (*FindNodeReq) GetNodeId ¶
func (m *FindNodeReq) GetNodeId() []byte
func (*FindNodeReq) ProtoMessage ¶
func (*FindNodeReq) ProtoMessage()
func (*FindNodeReq) Reset ¶
func (m *FindNodeReq) Reset()
func (*FindNodeReq) String ¶
func (m *FindNodeReq) String() string
type FindNodeResp ¶
type FindNodeResp struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` NodeInfos []*NodeInfo `protobuf:"bytes,2,rep,name=nodeInfos" json:"nodeInfos,omitempty"` }
func (*FindNodeResp) Descriptor ¶
func (*FindNodeResp) Descriptor() ([]byte, []int)
func (*FindNodeResp) GetMetadata ¶
func (m *FindNodeResp) GetMetadata() *Metadata
func (*FindNodeResp) GetNodeInfos ¶
func (m *FindNodeResp) GetNodeInfos() []*NodeInfo
func (*FindNodeResp) ProtoMessage ¶
func (*FindNodeResp) ProtoMessage()
func (*FindNodeResp) Reset ¶
func (m *FindNodeResp) Reset()
func (*FindNodeResp) String ¶
func (m *FindNodeResp) String() string
type HandshakeData ¶
type HandshakeData struct { SessionId []byte `protobuf:"bytes,1,opt,name=sessionId,proto3" json:"sessionId,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` Timestamp int64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` ClientVersion string `protobuf:"bytes,4,opt,name=clientVersion" json:"clientVersion,omitempty"` NetworkID int32 `protobuf:"varint,5,opt,name=networkID" json:"networkID,omitempty"` Protocol string `protobuf:"bytes,6,opt,name=protocol" json:"protocol,omitempty"` NodePubKey []byte `protobuf:"bytes,7,opt,name=nodePubKey,proto3" json:"nodePubKey,omitempty"` Iv []byte `protobuf:"bytes,8,opt,name=iv,proto3" json:"iv,omitempty"` PubKey []byte `protobuf:"bytes,9,opt,name=pubKey,proto3" json:"pubKey,omitempty"` Hmac []byte `protobuf:"bytes,10,opt,name=hmac,proto3" json:"hmac,omitempty"` TcpAddress string `protobuf:"bytes,11,opt,name=tcpAddress" json:"tcpAddress,omitempty"` Sign string `protobuf:"bytes,12,opt,name=sign" json:"sign,omitempty"` }
Handshake protocol data used for both request and response - sent unencrypted over the wire
func (*HandshakeData) Descriptor ¶
func (*HandshakeData) Descriptor() ([]byte, []int)
func (*HandshakeData) GetClientVersion ¶
func (m *HandshakeData) GetClientVersion() string
func (*HandshakeData) GetHmac ¶
func (m *HandshakeData) GetHmac() []byte
func (*HandshakeData) GetIv ¶
func (m *HandshakeData) GetIv() []byte
func (*HandshakeData) GetNetworkID ¶
func (m *HandshakeData) GetNetworkID() int32
func (*HandshakeData) GetNodePubKey ¶
func (m *HandshakeData) GetNodePubKey() []byte
func (*HandshakeData) GetPayload ¶
func (m *HandshakeData) GetPayload() []byte
func (*HandshakeData) GetProtocol ¶
func (m *HandshakeData) GetProtocol() string
func (*HandshakeData) GetPubKey ¶
func (m *HandshakeData) GetPubKey() []byte
func (*HandshakeData) GetSessionId ¶
func (m *HandshakeData) GetSessionId() []byte
func (*HandshakeData) GetSign ¶
func (m *HandshakeData) GetSign() string
func (*HandshakeData) GetTcpAddress ¶
func (m *HandshakeData) GetTcpAddress() string
func (*HandshakeData) GetTimestamp ¶
func (m *HandshakeData) GetTimestamp() int64
func (*HandshakeData) ProtoMessage ¶
func (*HandshakeData) ProtoMessage()
func (*HandshakeData) Reset ¶
func (m *HandshakeData) Reset()
func (*HandshakeData) String ¶
func (m *HandshakeData) String() string
type Metadata ¶
type Metadata struct { Protocol string `protobuf:"bytes,1,opt,name=protocol" json:"protocol,omitempty"` ReqId []byte `protobuf:"bytes,2,opt,name=reqId,proto3" json:"reqId,omitempty"` ClientVersion string `protobuf:"bytes,3,opt,name=clientVersion" json:"clientVersion,omitempty"` Timestamp int64 `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"` Gossip bool `protobuf:"varint,5,opt,name=gossip" json:"gossip,omitempty"` AuthPubKey []byte `protobuf:"bytes,6,opt,name=authPubKey,proto3" json:"authPubKey,omitempty"` AuthorSign string `protobuf:"bytes,7,opt,name=authorSign" json:"authorSign,omitempty"` }
func (*Metadata) Descriptor ¶
func (*Metadata) GetAuthPubKey ¶
func (*Metadata) GetAuthorSign ¶
func (*Metadata) GetClientVersion ¶
func (*Metadata) GetProtocol ¶
func (*Metadata) GetTimestamp ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
type NodeInfo ¶
type NodeInfo struct { NodeId []byte `protobuf:"bytes,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` TcpAddress string `protobuf:"bytes,2,opt,name=tcpAddress" json:"tcpAddress,omitempty"` }
func (*NodeInfo) Descriptor ¶
func (*NodeInfo) GetTcpAddress ¶
func (*NodeInfo) ProtoMessage ¶
func (*NodeInfo) ProtoMessage()
type PingReqData ¶
type PingReqData struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` Ping string `protobuf:"bytes,2,opt,name=ping" json:"ping,omitempty"` }
ping is our example protocol
func (*PingReqData) Descriptor ¶
func (*PingReqData) Descriptor() ([]byte, []int)
func (*PingReqData) GetMetadata ¶
func (m *PingReqData) GetMetadata() *Metadata
func (*PingReqData) GetPing ¶
func (m *PingReqData) GetPing() string
func (*PingReqData) ProtoMessage ¶
func (*PingReqData) ProtoMessage()
func (*PingReqData) Reset ¶
func (m *PingReqData) Reset()
func (*PingReqData) String ¶
func (m *PingReqData) String() string
type PingRespData ¶
type PingRespData struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` Pong string `protobuf:"bytes,2,opt,name=pong" json:"pong,omitempty"` }
func (*PingRespData) Descriptor ¶
func (*PingRespData) Descriptor() ([]byte, []int)
func (*PingRespData) GetMetadata ¶
func (m *PingRespData) GetMetadata() *Metadata
func (*PingRespData) GetPong ¶
func (m *PingRespData) GetPong() string
func (*PingRespData) ProtoMessage ¶
func (*PingRespData) ProtoMessage()
func (*PingRespData) Reset ¶
func (m *PingRespData) Reset()
func (*PingRespData) String ¶
func (m *PingRespData) String() string
type ProtocolMessage ¶
type ProtocolMessage struct {
Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
}
used for protocol messages (non-handshake) - this is the decrypted CommonMessageData.payload it allows multi310.445plexing back to higher level protocols data is here and not in CommonMessageData to avoid leaked data on unencrypted connections
func (*ProtocolMessage) AuthenticateAuthor ¶
func (msg *ProtocolMessage) AuthenticateAuthor() error
AuthenticateAuthor authenticates message author and returns an error if auth fails and nil otherwise.
func (*ProtocolMessage) Descriptor ¶
func (*ProtocolMessage) Descriptor() ([]byte, []int)
func (*ProtocolMessage) GetMetadata ¶
func (m *ProtocolMessage) GetMetadata() *Metadata
func (*ProtocolMessage) ProtoMessage ¶
func (*ProtocolMessage) ProtoMessage()
func (*ProtocolMessage) Reset ¶
func (m *ProtocolMessage) Reset()
func (*ProtocolMessage) String ¶
func (m *ProtocolMessage) String() string