Documentation
¶
Overview ¶
Code generated by ndn tlv codegen DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inner ¶
type Inner struct {
//+field:natural
Num uint64 `tlv:"0x01"`
}
func ParseInner ¶
Parses encoded data into an Inner structure using the provided WireView, with an option to ignore critical elements if specified.
type InnerEncoder ¶
type InnerEncoder struct {
Length uint
}
func (*InnerEncoder) Encode ¶
func (encoder *InnerEncoder) Encode(value *Inner) enc.Wire
Encodes the provided Inner value into a byte slice of the pre-determined length specified by the encoder, returning it as a single-element enc.Wire structure containing the encoded data.
func (*InnerEncoder) EncodeInto ¶
func (encoder *InnerEncoder) EncodeInto(value *Inner, buf []byte)
Encodes the given Inner struct into a binary format in the provided buffer, writing a type tag (1) followed by a length-prefixed encoding of the Num field as a natural number.
func (*InnerEncoder) Init ¶
func (encoder *InnerEncoder) Init(value *Inner)
Initializes the encoder's length by calculating the combined size of a fixed field and the variable-length encoded value of the `Num` field from the provided `Inner` struct.
type InnerParsingContext ¶
type InnerParsingContext struct {
}
func (*InnerParsingContext) Init ¶
func (context *InnerParsingContext) Init()
Initializes the InnerParsingContext, preparing it for parsing operations.
type IntStructMap ¶
type IntStructMap struct {
//+field:map:uint64:natural:0x87:*Inner:struct:Inner
Params map[uint64]*Inner `tlv:"0x85"`
}
func ParseIntStructMap ¶
func ParseIntStructMap(reader enc.WireView, ignoreCritical bool) (*IntStructMap, error)
Parses a wire-encoded Integer Struct Map into a Go struct, optionally ignoring critical fields.
func (*IntStructMap) Bytes ¶
func (value *IntStructMap) Bytes() []byte
Returns the encoded byte representation of the IntStructMap by concatenating its encoded components.
func (*IntStructMap) Encode ¶
func (value *IntStructMap) Encode() enc.Wire
Encodes the IntStructMap into a wire-encoded format for transmission or storage.
type IntStructMapEncoder ¶
type IntStructMapEncoder struct {
Length uint
Params_valencoder map[uint64]*struct {
Params_v_encoder InnerEncoder
}
}
func (*IntStructMapEncoder) Encode ¶
func (encoder *IntStructMapEncoder) Encode(value *IntStructMap) enc.Wire
Encodes an IntStructMap into a pre-allocated wire buffer, returning a structured byte slice suitable for NDN data transmission.
func (*IntStructMapEncoder) EncodeInto ¶
func (encoder *IntStructMapEncoder) EncodeInto(value *IntStructMap, buf []byte)
Encodes a map of uint64 keys and *Inner values into a binary buffer using type-length-value encoding with specific tag bytes (0x85 for keys, 0x87 for values) and length prefixes.
func (*IntStructMapEncoder) Init ¶
func (encoder *IntStructMapEncoder) Init(value *IntStructMap)
Initializes an IntStructMapEncoder with the provided IntStructMap, setting up nested encoders for each map entry and calculating the total encoded length including keys and nested values.
type IntStructMapParsingContext ¶
type IntStructMapParsingContext struct {
Params_v_context InnerParsingContext
}
func (*IntStructMapParsingContext) Init ¶
func (context *IntStructMapParsingContext) Init()
Initializes the internal Params_v_context field by invoking its Init method to prepare for parsing.
func (*IntStructMapParsingContext) Parse ¶
func (context *IntStructMapParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*IntStructMap, error)
Parses TLV-encoded data into an IntStructMap, handling map entries with uint64 keys and Inner values (type 133/135), while enforcing critical field rules based on the ignoreCritical flag.
type StringMap ¶
type StringMap struct {
//+field:map:string:string:0x87:[]byte:binary
Params map[string][]byte `tlv:"0x85"`
}
func ParseStringMap ¶
Parses a StringMap from a wire-encoded format using the provided reader, with an option to ignore critical unrecognized elements.
type StringMapEncoder ¶
func (*StringMapEncoder) Encode ¶
func (encoder *StringMapEncoder) Encode(value *StringMap) enc.Wire
Encodes the provided StringMap into a byte slice using the encoder's length and returns it as a single-component Wire structure.
func (*StringMapEncoder) EncodeInto ¶
func (encoder *StringMapEncoder) EncodeInto(value *StringMap, buf []byte)
Encodes a StringMap's key-value pairs into a TLV-encoded byte buffer using type identifiers 0x85 for keys and 0x87 for values.
func (*StringMapEncoder) Init ¶
func (encoder *StringMapEncoder) Init(value *StringMap)
Initializes the StringMapEncoder with the provided StringMap, calculating the total encoded length of all key-value parameters using TLV encoding rules.
type StringMapParsingContext ¶
type StringMapParsingContext struct {
}
func (*StringMapParsingContext) Init ¶
func (context *StringMapParsingContext) Init()
Initializes the StringMapParsingContext, preparing it for parsing operations with default settings.
func (*StringMapParsingContext) Parse ¶
func (context *StringMapParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*StringMap, error)
Parses a TLV-encoded StringMap from the provided wire format reader, extracting parameters (type 133) as key-value pairs (string keys and byte slices) and handling unrecognized or critical fields according to the ignoreCritical flag.