Documentation ¶
Overview ¶
Package talos implements modern ADV which supports large size for the values and tags.
Index ¶
- Constants
- type ADV
- func (a *ADV) Bytes() ([]byte, error)
- func (a *ADV) DeleteTag(t uint8) (ok bool)
- func (a *ADV) Marshal() ([]byte, error)
- func (a *ADV) ReadTag(t uint8) (val string, ok bool)
- func (a *ADV) ReadTagBytes(t uint8) (val []byte, ok bool)
- func (a *ADV) SetTag(t uint8, val string) (ok bool)
- func (a *ADV) SetTagBytes(t uint8, val []byte) (ok bool)
- func (a *ADV) Unmarshal(buf []byte) error
- type Tag
- type Value
Constants ¶
View Source
const ( Length = 256 * 1024 // 256KiB DataLength = Length - 40 Size = 2 * Length // Redundancy )
Basic constants configuring the ADV.
View Source
const ( Magic1 = 0x5a4b3c2d Magic2 = 0xa5b4c3d2 )
Magic constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ADV ¶
ADV implements the Talos extended ADV.
Layout (all in big-endian):
0x0000 4 bytes magic1 0x0004 4 bytes tag 0x0008 4 bytes size 0x000c (size) bytes value ... more tags -0x0024 32 bytes sha256 of the whole block with checksum set to zero -0x0004 4 bytes magic2
Whole data structure is written twice for redundancy.
func (*ADV) ReadTagBytes ¶ added in v0.9.0
ReadTagBytes to get tag value.
func (*ADV) SetTagBytes ¶ added in v0.9.0
SetTagBytes to set tag value.
Click to show internal directories.
Click to hide internal directories.