Documentation ¶
Index ¶
Constants ¶
View Source
const ( LegacyHeaderSize = 88 LegacyPayloadSize = 1228 )
View Source
const ( LegacyCodeID = uint8(0b0101_1010) LegacyDataID = uint8(0b1010_0101) MerkleMask = uint8(0xF0) MerkleCodeID = uint8(0x40) MerkleDataID = uint8(0x80) )
View Source
const ( FlagShredTickReferenceMask = uint8(0b0011_1111) FlagDataCompleteShred = uint8(0b0100_0000) FlagLastShredInSlot = uint8(0b1100_0000) )
Variables ¶
View Source
var ErrTooFewDataShreds = errors.New("too few data shreds")
Functions ¶
Types ¶
type CommonHeader ¶
type DataHeader ¶
func (*DataHeader) LastInSlot ¶
func (d *DataHeader) LastInSlot() bool
type LegacyCode ¶
type LegacyCode struct { Common CommonHeader Payload []byte }
func LegacyCodeFromPayload ¶
func LegacyCodeFromPayload(shred []byte) *LegacyCode
func (*LegacyCode) CommonHeader ¶
func (s *LegacyCode) CommonHeader() *CommonHeader
func (*LegacyCode) Data ¶
func (s *LegacyCode) Data() ([]byte, bool)
func (*LegacyCode) DataComplete ¶
func (s *LegacyCode) DataComplete() bool
func (*LegacyCode) DataHeader ¶
func (s *LegacyCode) DataHeader() *DataHeader
type LegacyData ¶
type LegacyData struct { Common CommonHeader Header DataHeader Payload []byte }
func LegacyDataFromPayload ¶
func LegacyDataFromPayload(shred []byte) *LegacyData
func (*LegacyData) CommonHeader ¶
func (s *LegacyData) CommonHeader() *CommonHeader
func (*LegacyData) Data ¶
func (s *LegacyData) Data() ([]byte, bool)
func (*LegacyData) DataComplete ¶
func (s *LegacyData) DataComplete() bool
func (*LegacyData) DataHeader ¶
func (s *LegacyData) DataHeader() *DataHeader
func (*LegacyData) ReferenceTick ¶
func (s *LegacyData) ReferenceTick() uint8
type MerkleCode ¶
type MerkleCode struct {
Common CommonHeader
}
func MerkleCodeFromPayload ¶
func MerkleCodeFromPayload(shred []byte) *MerkleCode
func (*MerkleCode) CommonHeader ¶
func (s *MerkleCode) CommonHeader() *CommonHeader
func (*MerkleCode) Data ¶
func (s *MerkleCode) Data() ([]byte, bool)
func (*MerkleCode) DataComplete ¶
func (s *MerkleCode) DataComplete() bool
func (*MerkleCode) DataHeader ¶
func (s *MerkleCode) DataHeader() *DataHeader
type MerkleData ¶
type MerkleData struct { Common CommonHeader Header DataHeader }
func MerkleDataFromPayload ¶
func MerkleDataFromPayload(shred []byte) *MerkleData
func (*MerkleData) CommonHeader ¶
func (s *MerkleData) CommonHeader() *CommonHeader
func (*MerkleData) Data ¶
func (s *MerkleData) Data() ([]byte, bool)
func (*MerkleData) DataComplete ¶
func (s *MerkleData) DataComplete() bool
func (*MerkleData) DataHeader ¶
func (s *MerkleData) DataHeader() *DataHeader
type Shred ¶
type Shred interface { CommonHeader() *CommonHeader DataHeader() *DataHeader Data() ([]byte, bool) DataComplete() bool }
func NewShredFromSerialized ¶
Click to show internal directories.
Click to hide internal directories.