gen_map

package
v0.0.0-...-d1ba03b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 3 Imported by: 0

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

func ParseInner(reader enc.WireView, ignoreCritical bool) (*Inner, error)

Parses encoded data into an Inner structure using the provided WireView, with an option to ignore critical elements if specified.

func (*Inner) Bytes

func (value *Inner) Bytes() []byte

Returns the byte slice representing the TLV-encoded form of the Inner value.

func (*Inner) Encode

func (value *Inner) Encode() enc.Wire

Encodes the Inner value into its wire format representation using an InnerEncoder.

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.

func (*InnerParsingContext) Parse

func (context *InnerParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*Inner, error)

Parses TLV-encoded data into an Inner structure, extracting a required uint64 "Num" field (type 1) and handling critical/non-critical fields according to the ignoreCritical flag.

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

func ParseStringMap(reader enc.WireView, ignoreCritical bool) (*StringMap, error)

Parses a StringMap from a wire-encoded format using the provided reader, with an option to ignore critical unrecognized elements.

func (*StringMap) Bytes

func (value *StringMap) Bytes() []byte

Returns the byte slice formed by encoding and joining the elements of the StringMap.

func (*StringMap) Encode

func (value *StringMap) Encode() enc.Wire

Encodes the StringMap value into a Wire format using a StringMapEncoder.

type StringMapEncoder

type StringMapEncoder struct {
	Length uint

	Params_valencoder map[string]*struct {
	}
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL