Documentation
¶
Overview ¶
Package namespace contains the core namespaced data types. PrefixedData represents the leaf data that gets pushed to the NMT (data prefixed with an ID).
Index ¶
Constants ¶
const IDMaxSize = math.MaxUint8
IDMaxSize defines the max. allowed namespace ID size in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDSize ¶
type IDSize uint8
IDSize is the number of bytes a namespace uses. Valid values are in [0,255].
type PrefixedData ¶
type PrefixedData []byte
PrefixedData simply represents a slice of bytes which consists of a namespace.ID and raw data. The user has to guarantee that the bytes are valid namespace prefixed data. Go's type system does not allow enforcing the structure we want: [namespaceID, rawData ...], especially as this type does not expect any particular size for the namespace.
type PrefixedData8 ¶
type PrefixedData8 []byte
PrefixedData8 like PrefixedData is just a slice of bytes. It assumes that the slice it represents is at least 8 bytes. This assumption is not enforced by the type system though.
func (PrefixedData8) Data ¶
func (d PrefixedData8) Data() []byte
func (PrefixedData8) NamespaceID ¶
func (d PrefixedData8) NamespaceID() ID