Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
Magic uint32
MessageType MessageType
Timestamp time.Time
Message Message
Signature crypto.Signature
}
func NewEnvelope ¶
type HashCacher ¶
type HashCacher struct {
// contains filtered or unexported fields
}
type Hello ¶
type Hello struct {
HashCacher
ProtocolVersion uint32
LocalNonce [32]byte
RemoteNonce [32]byte
PublicKey *btcec.PublicKey
UserAgent string
}
func (*Hello) MsgType ¶
func (h *Hello) MsgType() MessageType
type HelloAck ¶
type HelloAck struct {
HashCacher
Nonce [32]byte
}
func (*HelloAck) MsgType ¶
func (h *HelloAck) MsgType() MessageType
type Message ¶
type Message interface {
crypto.Hasher
dwire.EncodeDecoder
MsgType() MessageType
Equals(other Message) bool
}
type MessageType ¶
type MessageType uint16
const ( MessageTypeHello MessageType = iota MessageTypeHelloAck MessageTypePing MessageTypeUpdate MessageTypeNilUpdate MessageTypeTreeBaseReq MessageTypeTreeBaseRes MessageTypeSectorReq MessageTypeSectorRes MessageTypePeerReq MessageTypePeerRes MessageTypeUpdateReq MessageTypeNameRes )
func (MessageType) String ¶
func (t MessageType) String() string
type NilUpdate ¶
type NilUpdate struct {
HashCacher
Name string
// contains filtered or unexported fields
}
func NewNilUpdate ¶
func (*NilUpdate) MsgType ¶
func (n *NilUpdate) MsgType() MessageType
type PeerReq ¶
type PeerReq struct {
HashCacher
}
func (*PeerReq) MsgType ¶
func (p *PeerReq) MsgType() MessageType
type PeerRes ¶
type PeerRes struct {
HashCacher
Peers []*Peer
}
func (*PeerRes) MsgType ¶
func (p *PeerRes) MsgType() MessageType
type Ping ¶
type Ping struct {
HashCacher
}
func (*Ping) MsgType ¶
func (p *Ping) MsgType() MessageType
type PublicKeyEncoder ¶
type SectorReq ¶
type SectorReq struct {
HashCacher
Name string
SectorID uint8
}
func (*SectorReq) MsgType ¶
func (s *SectorReq) MsgType() MessageType
type SectorRes ¶
type SectorRes struct {
HashCacher
Name string
SectorID uint8
Sector blob.Sector
}
func (*SectorRes) MsgType ¶
func (s *SectorRes) MsgType() MessageType
type TreeBaseReq ¶
type TreeBaseReq struct {
HashCacher
Name string
}
func (*TreeBaseReq) Equals ¶
func (d *TreeBaseReq) Equals(other Message) bool
func (*TreeBaseReq) MsgType ¶
func (d *TreeBaseReq) MsgType() MessageType
type TreeBaseRes ¶
type TreeBaseRes struct {
HashCacher
Name string
MerkleBase blob.MerkleBase
}
func (*TreeBaseRes) Equals ¶
func (d *TreeBaseRes) Equals(other Message) bool
func (*TreeBaseRes) MsgType ¶
func (d *TreeBaseRes) MsgType() MessageType
type Update ¶
type Update struct {
HashCacher
Name string
Timestamp time.Time
MerkleRoot crypto.Hash
ReservedRoot crypto.Hash
Signature crypto.Signature
}
func (*Update) MsgType ¶
func (u *Update) MsgType() MessageType
type UpdateReq ¶
type UpdateReq struct {
HashCacher
Name string
Timestamp time.Time
}
func (*UpdateReq) MsgType ¶
func (n *UpdateReq) MsgType() MessageType
Click to show internal directories.
Click to hide internal directories.