Documentation ¶
Index ¶
- Variables
- func GenEncodeTypeNum(typeNum uint64) (string, error)
- func GenNaturalNumberDecode(code string) (string, error)
- func GenNaturalNumberEncode(code string, isTlv bool) (string, error)
- func GenNaturalNumberLen(code string, isTlv bool) (string, error)
- func GenSwitchWire() (string, error)
- func GenSwitchWirePlan() (string, error)
- func GenTlvNumberDecode(code string) (string, error)
- func GenTypeNumLen(typeNum uint64) (string, error)
- type BaseTlvField
- func (*BaseTlvField) GenEncodeInto() (string, error)
- func (*BaseTlvField) GenEncoderStruct() (string, error)
- func (*BaseTlvField) GenEncodingLength() (string, error)
- func (*BaseTlvField) GenEncodingWirePlan() (string, error)
- func (*BaseTlvField) GenFromDict() (string, error)
- func (*BaseTlvField) GenInitContext() (string, error)
- func (*BaseTlvField) GenInitEncoder() (string, error)
- func (*BaseTlvField) GenParsingContextStruct() (string, error)
- func (*BaseTlvField) GenReadFrom() (string, error)
- func (*BaseTlvField) GenSkipProcess() (string, error)
- func (*BaseTlvField) GenToDict() (string, error)
- func (f *BaseTlvField) Name() string
- func (f *BaseTlvField) TypeNum() uint64
- type BinaryField
- func (f *BinaryField) GenEncodeInto() (string, error)
- func (f *BinaryField) GenEncodingLength() (string, error)
- func (f *BinaryField) GenEncodingWirePlan() (string, error)
- func (f *BinaryField) GenFromDict() (string, error)
- func (f *BinaryField) GenReadFrom() (string, error)
- func (f *BinaryField) GenSkipProcess() (string, error)
- func (f *BinaryField) GenToDict() (string, error)
- type BoolField
- func (f *BoolField) GenEncodeInto() (string, error)
- func (f *BoolField) GenEncodingLength() (string, error)
- func (f *BoolField) GenEncodingWirePlan() (string, error)
- func (f *BoolField) GenFromDict() (string, error)
- func (f *BoolField) GenReadFrom() (string, error)
- func (f *BoolField) GenSkipProcess() (string, error)
- func (f *BoolField) GenToDict() (string, error)
- type FixedUintField
- func (f *FixedUintField) GenEncodeInto() (string, error)
- func (f *FixedUintField) GenEncodingLength() (string, error)
- func (f *FixedUintField) GenEncodingWirePlan() (string, error)
- func (f *FixedUintField) GenFromDict() (string, error)
- func (f *FixedUintField) GenReadFrom() (string, error)
- func (f *FixedUintField) GenSkipProcess() (string, error)
- func (f *FixedUintField) GenToDict() (string, error)
- type Generator
- type InterestNameField
- func (f *InterestNameField) GenEncodeInto() (string, error)
- func (f *InterestNameField) GenEncoderStruct() (string, error)
- func (f *InterestNameField) GenEncodingLength() (string, error)
- func (f *InterestNameField) GenEncodingWirePlan() (string, error)
- func (f *InterestNameField) GenInitContext() (string, error)
- func (f *InterestNameField) GenInitEncoder() (string, error)
- func (f *InterestNameField) GenParsingContextStruct() (string, error)
- func (f *InterestNameField) GenReadFrom() (string, error)
- func (f *InterestNameField) GenSkipProcess() (string, error)
- type MapField
- func (f *MapField) GenEncodeInto() (string, error)
- func (f *MapField) GenEncoderStruct() (string, error)
- func (f *MapField) GenEncodingLength() (string, error)
- func (f *MapField) GenEncodingWirePlan() (string, error)
- func (f *MapField) GenFromDict() (string, error)
- func (f *MapField) GenInitContext() (string, error)
- func (f *MapField) GenInitEncoder() (string, error)
- func (f *MapField) GenParsingContextStruct() (string, error)
- func (f *MapField) GenReadFrom() (string, error)
- func (f *MapField) GenSkipProcess() (string, error)
- func (f *MapField) GenToDict() (string, error)
- type NameField
- func (f *NameField) GenEncodeInto() (string, error)
- func (f *NameField) GenEncoderStruct() (string, error)
- func (f *NameField) GenEncodingLength() (string, error)
- func (f *NameField) GenEncodingWirePlan() (string, error)
- func (f *NameField) GenFromDict() (string, error)
- func (f *NameField) GenInitEncoder() (string, error)
- func (f *NameField) GenReadFrom() (string, error)
- func (f *NameField) GenSkipProcess() (string, error)
- func (f *NameField) GenToDict() (string, error)
- type NaturalField
- func (f *NaturalField) GenEncodeInto() (string, error)
- func (f *NaturalField) GenEncodingLength() (string, error)
- func (f *NaturalField) GenEncodingWirePlan() (string, error)
- func (f *NaturalField) GenFromDict() (string, error)
- func (f *NaturalField) GenReadFrom() (string, error)
- func (f *NaturalField) GenSkipProcess() (string, error)
- func (f *NaturalField) GenToDict() (string, error)
- type OffsetMarker
- func (f *OffsetMarker) GenEncodeInto() (string, error)
- func (f *OffsetMarker) GenEncoderStruct() (string, error)
- func (f *OffsetMarker) GenEncodingLength() (string, error)
- func (f *OffsetMarker) GenParsingContextStruct() (string, error)
- func (f *OffsetMarker) GenReadFrom() (string, error)
- func (f *OffsetMarker) GenSkipProcess() (string, error)
- type ProcedureArgument
- type RangeMarker
- func (f *RangeMarker) GenEncodeInto() (string, error)
- func (f *RangeMarker) GenEncoderStruct() (string, error)
- func (f *RangeMarker) GenEncodingLength() (string, error)
- func (f *RangeMarker) GenParsingContextStruct() (string, error)
- func (f *RangeMarker) GenReadFrom() (string, error)
- func (f *RangeMarker) GenSkipProcess() (string, error)
- type SequenceField
- func (f *SequenceField) GenEncodeInto() (string, error)
- func (f *SequenceField) GenEncoderStruct() (string, error)
- func (f *SequenceField) GenEncodingLength() (string, error)
- func (f *SequenceField) GenEncodingWirePlan() (string, error)
- func (f *SequenceField) GenFromDict() (string, error)
- func (f *SequenceField) GenInitContext() (string, error)
- func (f *SequenceField) GenInitEncoder() (string, error)
- func (f *SequenceField) GenParsingContextStruct() (string, error)
- func (f *SequenceField) GenReadFrom() (string, error)
- func (f *SequenceField) GenSkipProcess() (string, error)
- func (f *SequenceField) GenToDict() (string, error)
- type SignatureField
- func (f *SignatureField) GenEncodeInto() (string, error)
- func (f *SignatureField) GenEncoderStruct() (string, error)
- func (f *SignatureField) GenEncodingLength() (string, error)
- func (f *SignatureField) GenEncodingWirePlan() (string, error)
- func (f *SignatureField) GenInitContext() (string, error)
- func (f *SignatureField) GenInitEncoder() (string, error)
- func (f *SignatureField) GenParsingContextStruct() (string, error)
- func (f *SignatureField) GenReadFrom() (string, error)
- func (f *SignatureField) GenSkipProcess() (string, error)
- type StringField
- func (f *StringField) GenEncodeInto() (string, error)
- func (f *StringField) GenEncodingLength() (string, error)
- func (f *StringField) GenEncodingWirePlan() (string, error)
- func (f *StringField) GenFromDict() (string, error)
- func (f *StringField) GenReadFrom() (string, error)
- func (f *StringField) GenSkipProcess() (string, error)
- func (f *StringField) GenToDict() (string, error)
- type StructField
- func (f *StructField) GenEncodeInto() (string, error)
- func (f *StructField) GenEncoderStruct() (string, error)
- func (f *StructField) GenEncodingLength() (string, error)
- func (f *StructField) GenEncodingWirePlan() (string, error)
- func (f *StructField) GenFromDict() (string, error)
- func (f *StructField) GenInitContext() (string, error)
- func (f *StructField) GenInitEncoder() (string, error)
- func (f *StructField) GenParsingContextStruct() (string, error)
- func (f *StructField) GenReadFrom() (string, error)
- func (f *StructField) GenSkipProcess() (string, error)
- func (f *StructField) GenToDict() (string, error)
- type TimeField
- type TlvField
- func CreateField(className string, name string, typeNum uint64, annotation string, ...) (TlvField, error)
- func NewBinaryField(name string, typeNum uint64, _ string, _ *TlvModel) (TlvField, error)
- func NewBoolField(name string, typeNum uint64, _ string, _ *TlvModel) (TlvField, error)
- func NewFixedUintField(name string, typeNum uint64, annotation string, _ *TlvModel) (TlvField, error)
- func NewInterestNameField(name string, typeNum uint64, annotation string, _ *TlvModel) (TlvField, error)
- func NewMapField(name string, typeNum uint64, annotation string, model *TlvModel) (TlvField, error)
- func NewNameField(name string, typeNum uint64, _ string, _ *TlvModel) (TlvField, error)
- func NewNaturalField(name string, typeNum uint64, annotation string, _ *TlvModel) (TlvField, error)
- func NewOffsetMarker(name string, _ uint64, _ string, model *TlvModel) (TlvField, error)
- func NewProcedureArgument(name string, _ uint64, annotation string, _ *TlvModel) (TlvField, error)
- func NewRangeMarker(name string, typeNum uint64, annotation string, model *TlvModel) (TlvField, error)
- func NewSequenceField(name string, typeNum uint64, annotation string, model *TlvModel) (TlvField, error)
- func NewSignatureField(name string, typeNum uint64, annotation string, model *TlvModel) (TlvField, error)
- func NewStringField(name string, typeNum uint64, annotation string, _ *TlvModel) (TlvField, error)
- func NewStructField(name string, typeNum uint64, annotation string, model *TlvModel) (TlvField, error)
- func NewTimeField(name string, typeNum uint64, annotation string, _ *TlvModel) (TlvField, error)
- func NewWireField(name string, typeNum uint64, _ string, model *TlvModel) (TlvField, error)
- func ParseField(name string, typeNum uint64, fieldStr string, model *TlvModel) (TlvField, error)
- type TlvModel
- func (m *TlvModel) GenEncodeInto(buf *bytes.Buffer) error
- func (m *TlvModel) GenEncoderStruct(buf *bytes.Buffer) error
- func (m *TlvModel) GenFromDict(buf *bytes.Buffer) error
- func (m *TlvModel) GenInitContext(buf *bytes.Buffer) error
- func (m *TlvModel) GenInitEncoder(buf *bytes.Buffer) error
- func (m *TlvModel) GenParsingContextStruct(buf *bytes.Buffer) error
- func (m *TlvModel) GenReadFrom(buf *bytes.Buffer) error
- func (m *TlvModel) GenToDict(buf *bytes.Buffer) error
- func (m *TlvModel) Generate(buf *bytes.Buffer) error
- func (m *TlvModel) ProcessOption(option string)
- type WireField
- func (f *WireField) GenEncodeInto() (string, error)
- func (f *WireField) GenEncoderStruct() (string, error)
- func (f *WireField) GenEncodingLength() (string, error)
- func (f *WireField) GenEncodingWirePlan() (string, error)
- func (f *WireField) GenInitEncoder() (string, error)
- func (f *WireField) GenReadFrom() (string, error)
- func (f *WireField) GenSkipProcess() (string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidField = errors.New("invalid TlvField. Please check the annotation (including type and arguments)")
var ErrWrongTypeNumber = errors.New("invalid type number")
Functions ¶
func GenEncodeTypeNum ¶
func GenNaturalNumberDecode ¶
func GenSwitchWire ¶
func GenSwitchWirePlan ¶
func GenTlvNumberDecode ¶
func GenTypeNumLen ¶
Types ¶
type BaseTlvField ¶
type BaseTlvField struct {
// contains filtered or unexported fields
}
BaseTlvField is a base class for all TLV fields. Golang's inheritance is not supported, so we use this class to disable optional functions.
func (*BaseTlvField) GenEncodeInto ¶
func (*BaseTlvField) GenEncodeInto() (string, error)
func (*BaseTlvField) GenEncoderStruct ¶
func (*BaseTlvField) GenEncoderStruct() (string, error)
func (*BaseTlvField) GenEncodingLength ¶
func (*BaseTlvField) GenEncodingLength() (string, error)
func (*BaseTlvField) GenEncodingWirePlan ¶
func (*BaseTlvField) GenEncodingWirePlan() (string, error)
func (*BaseTlvField) GenFromDict ¶
func (*BaseTlvField) GenFromDict() (string, error)
func (*BaseTlvField) GenInitContext ¶
func (*BaseTlvField) GenInitContext() (string, error)
func (*BaseTlvField) GenInitEncoder ¶
func (*BaseTlvField) GenInitEncoder() (string, error)
func (*BaseTlvField) GenParsingContextStruct ¶
func (*BaseTlvField) GenParsingContextStruct() (string, error)
func (*BaseTlvField) GenReadFrom ¶
func (*BaseTlvField) GenReadFrom() (string, error)
func (*BaseTlvField) GenSkipProcess ¶
func (*BaseTlvField) GenSkipProcess() (string, error)
func (*BaseTlvField) GenToDict ¶
func (*BaseTlvField) GenToDict() (string, error)
func (*BaseTlvField) Name ¶
func (f *BaseTlvField) Name() string
func (*BaseTlvField) TypeNum ¶
func (f *BaseTlvField) TypeNum() uint64
type BinaryField ¶
type BinaryField struct {
BaseTlvField
}
BinaryField represents a binary string field of type Buffer or []byte. BinaryField always makes a copy during encoding.
func (*BinaryField) GenEncodeInto ¶
func (f *BinaryField) GenEncodeInto() (string, error)
func (*BinaryField) GenEncodingLength ¶
func (f *BinaryField) GenEncodingLength() (string, error)
func (*BinaryField) GenEncodingWirePlan ¶
func (f *BinaryField) GenEncodingWirePlan() (string, error)
func (*BinaryField) GenFromDict ¶
func (f *BinaryField) GenFromDict() (string, error)
func (*BinaryField) GenReadFrom ¶
func (f *BinaryField) GenReadFrom() (string, error)
func (*BinaryField) GenSkipProcess ¶
func (f *BinaryField) GenSkipProcess() (string, error)
func (*BinaryField) GenToDict ¶
func (f *BinaryField) GenToDict() (string, error)
type BoolField ¶
type BoolField struct {
BaseTlvField
}
BoolField represents a boolean field.
func (*BoolField) GenEncodeInto ¶
func (*BoolField) GenEncodingLength ¶
func (*BoolField) GenEncodingWirePlan ¶
func (*BoolField) GenFromDict ¶
func (*BoolField) GenReadFrom ¶
func (*BoolField) GenSkipProcess ¶
type FixedUintField ¶
type FixedUintField struct { BaseTlvField // contains filtered or unexported fields }
FixedUintField represents a fixed-length unsigned integer.
func (*FixedUintField) GenEncodeInto ¶
func (f *FixedUintField) GenEncodeInto() (string, error)
func (*FixedUintField) GenEncodingLength ¶
func (f *FixedUintField) GenEncodingLength() (string, error)
func (*FixedUintField) GenEncodingWirePlan ¶
func (f *FixedUintField) GenEncodingWirePlan() (string, error)
func (*FixedUintField) GenFromDict ¶ added in v0.0.4
func (f *FixedUintField) GenFromDict() (string, error)
func (*FixedUintField) GenReadFrom ¶
func (f *FixedUintField) GenReadFrom() (string, error)
func (*FixedUintField) GenSkipProcess ¶
func (f *FixedUintField) GenSkipProcess() (string, error)
func (*FixedUintField) GenToDict ¶ added in v0.0.4
func (f *FixedUintField) GenToDict() (string, error)
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator() *Generator
type InterestNameField ¶
type InterestNameField struct { BaseTlvField // contains filtered or unexported fields }
InterestNameField represents the Name field in an Interest, which may contain a ParametersSha256DigestComponent. Requires needDigest as input, indicating whether ParametersSha256Digest component is required. It will modify the input Name value and generate a final Name value.
func (*InterestNameField) GenEncodeInto ¶
func (f *InterestNameField) GenEncodeInto() (string, error)
func (*InterestNameField) GenEncoderStruct ¶
func (f *InterestNameField) GenEncoderStruct() (string, error)
func (*InterestNameField) GenEncodingLength ¶
func (f *InterestNameField) GenEncodingLength() (string, error)
func (*InterestNameField) GenEncodingWirePlan ¶
func (f *InterestNameField) GenEncodingWirePlan() (string, error)
func (*InterestNameField) GenInitContext ¶
func (f *InterestNameField) GenInitContext() (string, error)
func (*InterestNameField) GenInitEncoder ¶
func (f *InterestNameField) GenInitEncoder() (string, error)
func (*InterestNameField) GenParsingContextStruct ¶
func (f *InterestNameField) GenParsingContextStruct() (string, error)
func (*InterestNameField) GenReadFrom ¶
func (f *InterestNameField) GenReadFrom() (string, error)
func (*InterestNameField) GenSkipProcess ¶
func (f *InterestNameField) GenSkipProcess() (string, error)
type MapField ¶ added in v0.0.4
type MapField struct { BaseTlvField KeyField TlvField ValField TlvField KeyFieldType string ValFieldType string }
func (*MapField) GenEncodeInto ¶ added in v0.0.4
func (*MapField) GenEncoderStruct ¶ added in v0.0.4
func (*MapField) GenEncodingLength ¶ added in v0.0.4
func (*MapField) GenEncodingWirePlan ¶ added in v0.0.4
func (*MapField) GenFromDict ¶ added in v0.0.4
func (*MapField) GenInitContext ¶ added in v0.0.4
func (*MapField) GenInitEncoder ¶ added in v0.0.4
func (*MapField) GenParsingContextStruct ¶ added in v0.0.4
func (*MapField) GenReadFrom ¶ added in v0.0.4
func (*MapField) GenSkipProcess ¶ added in v0.0.4
type NameField ¶
type NameField struct {
BaseTlvField
}
NameField represents a name field.
func (*NameField) GenEncodeInto ¶
func (*NameField) GenEncoderStruct ¶
func (*NameField) GenEncodingLength ¶
func (*NameField) GenEncodingWirePlan ¶
func (*NameField) GenFromDict ¶
func (*NameField) GenInitEncoder ¶
func (*NameField) GenReadFrom ¶
func (*NameField) GenSkipProcess ¶
type NaturalField ¶
type NaturalField struct { BaseTlvField // contains filtered or unexported fields }
NaturalField represents a natural number field.
func (*NaturalField) GenEncodeInto ¶
func (f *NaturalField) GenEncodeInto() (string, error)
func (*NaturalField) GenEncodingLength ¶
func (f *NaturalField) GenEncodingLength() (string, error)
func (*NaturalField) GenEncodingWirePlan ¶
func (f *NaturalField) GenEncodingWirePlan() (string, error)
func (*NaturalField) GenFromDict ¶
func (f *NaturalField) GenFromDict() (string, error)
func (*NaturalField) GenReadFrom ¶
func (f *NaturalField) GenReadFrom() (string, error)
func (*NaturalField) GenSkipProcess ¶
func (f *NaturalField) GenSkipProcess() (string, error)
func (*NaturalField) GenToDict ¶
func (f *NaturalField) GenToDict() (string, error)
type OffsetMarker ¶
type OffsetMarker struct { BaseTlvField // contains filtered or unexported fields }
OffsetMarker is a marker that marks a position in the wire.
func (*OffsetMarker) GenEncodeInto ¶
func (f *OffsetMarker) GenEncodeInto() (string, error)
func (*OffsetMarker) GenEncoderStruct ¶
func (f *OffsetMarker) GenEncoderStruct() (string, error)
func (*OffsetMarker) GenEncodingLength ¶
func (f *OffsetMarker) GenEncodingLength() (string, error)
func (*OffsetMarker) GenParsingContextStruct ¶
func (f *OffsetMarker) GenParsingContextStruct() (string, error)
func (*OffsetMarker) GenReadFrom ¶
func (f *OffsetMarker) GenReadFrom() (string, error)
func (*OffsetMarker) GenSkipProcess ¶
func (f *OffsetMarker) GenSkipProcess() (string, error)
type ProcedureArgument ¶
type ProcedureArgument struct { BaseTlvField // contains filtered or unexported fields }
ProcedureArgument is a variable used during encoding and decoding procedure.
func (*ProcedureArgument) GenEncoderStruct ¶
func (f *ProcedureArgument) GenEncoderStruct() (string, error)
func (*ProcedureArgument) GenParsingContextStruct ¶
func (f *ProcedureArgument) GenParsingContextStruct() (string, error)
type RangeMarker ¶
type RangeMarker struct { BaseTlvField // contains filtered or unexported fields }
RangeMarker is a marker that catches a range in the wire from an OffsetMarker to current position. It is necessary because the offset given by OffsetMarker is not necessarily from the beginning of the outmost TLV, when parsing. It is the same with OffsetMarker for encoding.
func (*RangeMarker) GenEncodeInto ¶
func (f *RangeMarker) GenEncodeInto() (string, error)
func (*RangeMarker) GenEncoderStruct ¶
func (f *RangeMarker) GenEncoderStruct() (string, error)
func (*RangeMarker) GenEncodingLength ¶
func (f *RangeMarker) GenEncodingLength() (string, error)
func (*RangeMarker) GenParsingContextStruct ¶
func (f *RangeMarker) GenParsingContextStruct() (string, error)
func (*RangeMarker) GenReadFrom ¶
func (f *RangeMarker) GenReadFrom() (string, error)
func (*RangeMarker) GenSkipProcess ¶
func (f *RangeMarker) GenSkipProcess() (string, error)
type SequenceField ¶
type SequenceField struct { BaseTlvField SubField TlvField FieldType string }
SequenceField represents a slice field of another supported field type.
func (*SequenceField) GenEncodeInto ¶
func (f *SequenceField) GenEncodeInto() (string, error)
func (*SequenceField) GenEncoderStruct ¶
func (f *SequenceField) GenEncoderStruct() (string, error)
func (*SequenceField) GenEncodingLength ¶
func (f *SequenceField) GenEncodingLength() (string, error)
func (*SequenceField) GenEncodingWirePlan ¶
func (f *SequenceField) GenEncodingWirePlan() (string, error)
func (*SequenceField) GenFromDict ¶
func (f *SequenceField) GenFromDict() (string, error)
func (*SequenceField) GenInitContext ¶
func (f *SequenceField) GenInitContext() (string, error)
func (*SequenceField) GenInitEncoder ¶
func (f *SequenceField) GenInitEncoder() (string, error)
func (*SequenceField) GenParsingContextStruct ¶
func (f *SequenceField) GenParsingContextStruct() (string, error)
func (*SequenceField) GenReadFrom ¶
func (f *SequenceField) GenReadFrom() (string, error)
func (*SequenceField) GenSkipProcess ¶
func (f *SequenceField) GenSkipProcess() (string, error)
func (*SequenceField) GenToDict ¶
func (f *SequenceField) GenToDict() (string, error)
type SignatureField ¶
type SignatureField struct { BaseTlvField // contains filtered or unexported fields }
SignatureField represents SignatureValue field It handles the signature covered part, and the position of the signature. Requires estimated length of the signature as input, which should be >= the real length. When estimated length is 0, the signature is not encoded.
func (*SignatureField) GenEncodeInto ¶
func (f *SignatureField) GenEncodeInto() (string, error)
func (*SignatureField) GenEncoderStruct ¶
func (f *SignatureField) GenEncoderStruct() (string, error)
func (*SignatureField) GenEncodingLength ¶
func (f *SignatureField) GenEncodingLength() (string, error)
func (*SignatureField) GenEncodingWirePlan ¶
func (f *SignatureField) GenEncodingWirePlan() (string, error)
func (*SignatureField) GenInitContext ¶
func (f *SignatureField) GenInitContext() (string, error)
func (*SignatureField) GenInitEncoder ¶
func (f *SignatureField) GenInitEncoder() (string, error)
func (*SignatureField) GenParsingContextStruct ¶
func (f *SignatureField) GenParsingContextStruct() (string, error)
func (*SignatureField) GenReadFrom ¶
func (f *SignatureField) GenReadFrom() (string, error)
func (*SignatureField) GenSkipProcess ¶
func (f *SignatureField) GenSkipProcess() (string, error)
type StringField ¶
type StringField struct { BaseTlvField // contains filtered or unexported fields }
StringField represents a UTF-8 encoded string.
func (*StringField) GenEncodeInto ¶
func (f *StringField) GenEncodeInto() (string, error)
func (*StringField) GenEncodingLength ¶
func (f *StringField) GenEncodingLength() (string, error)
func (*StringField) GenEncodingWirePlan ¶
func (f *StringField) GenEncodingWirePlan() (string, error)
func (*StringField) GenFromDict ¶
func (f *StringField) GenFromDict() (string, error)
func (*StringField) GenReadFrom ¶
func (f *StringField) GenReadFrom() (string, error)
func (*StringField) GenSkipProcess ¶
func (f *StringField) GenSkipProcess() (string, error)
func (*StringField) GenToDict ¶
func (f *StringField) GenToDict() (string, error)
type StructField ¶
type StructField struct { BaseTlvField StructType string // contains filtered or unexported fields }
StructField represents a struct field of another TlvModel.
func (*StructField) GenEncodeInto ¶
func (f *StructField) GenEncodeInto() (string, error)
func (*StructField) GenEncoderStruct ¶
func (f *StructField) GenEncoderStruct() (string, error)
func (*StructField) GenEncodingLength ¶
func (f *StructField) GenEncodingLength() (string, error)
func (*StructField) GenEncodingWirePlan ¶
func (f *StructField) GenEncodingWirePlan() (string, error)
func (*StructField) GenFromDict ¶
func (f *StructField) GenFromDict() (string, error)
func (*StructField) GenInitContext ¶
func (f *StructField) GenInitContext() (string, error)
func (*StructField) GenInitEncoder ¶
func (f *StructField) GenInitEncoder() (string, error)
func (*StructField) GenParsingContextStruct ¶
func (f *StructField) GenParsingContextStruct() (string, error)
func (*StructField) GenReadFrom ¶
func (f *StructField) GenReadFrom() (string, error)
func (*StructField) GenSkipProcess ¶
func (f *StructField) GenSkipProcess() (string, error)
func (*StructField) GenToDict ¶
func (f *StructField) GenToDict() (string, error)
type TimeField ¶
type TimeField struct { BaseTlvField // contains filtered or unexported fields }
TimeField represents a time field, recorded as milliseconds.
func (*TimeField) GenEncodeInto ¶
func (*TimeField) GenEncodingLength ¶
func (*TimeField) GenEncodingWirePlan ¶
func (*TimeField) GenReadFrom ¶
func (*TimeField) GenSkipProcess ¶
type TlvField ¶
type TlvField interface { Name() string TypeNum() uint64 GenEncodingLength() (string, error) GenEncodingWirePlan() (string, error) GenEncodeInto() (string, error) GenEncoderStruct() (string, error) GenInitEncoder() (string, error) GenParsingContextStruct() (string, error) GenInitContext() (string, error) GenReadFrom() (string, error) GenSkipProcess() (string, error) GenToDict() (string, error) GenFromDict() (string, error) }
func CreateField ¶
func NewBinaryField ¶
func NewBoolField ¶
func NewFixedUintField ¶
func NewInterestNameField ¶
func NewMapField ¶ added in v0.0.4
func NewNameField ¶
func NewNaturalField ¶
func NewOffsetMarker ¶
NewOffsetMarker creates an offset marker field.
func NewProcedureArgument ¶
NewProcedureArgument creates a ProcedureArgument field.
func NewRangeMarker ¶
func NewRangeMarker(name string, typeNum uint64, annotation string, model *TlvModel) (TlvField, error)
NewOffsetMarker creates an range marker field.
func NewSequenceField ¶
func NewSignatureField ¶
func NewStringField ¶
func NewStructField ¶
func NewTimeField ¶
func NewWireField ¶
type TlvModel ¶
type TlvModel struct { Name string // PrivMethods indicates whether generated methods are private. False by default. // Enabled by `private` annotation. PrivMethods bool // NoCopy indicates whether to avoid copying []byte into wire. False by default. // Enabled by `nocopy` annotation. NoCopy bool // GenDict indicates whether to generate ToDict/FromDict for this model. GenDict bool // WithParsingContext is true if any field has a non-trivial GenParsingContextStruct() WithParsingContext bool // Fields are the TLV fields of the structure. Fields []TlvField }
TlvModel represents a TLV encodable structure.
func (*TlvModel) GenParsingContextStruct ¶
func (*TlvModel) ProcessOption ¶
type WireField ¶
type WireField struct { BaseTlvField // contains filtered or unexported fields }
WireField represents a binary string field of type Wire or [][]byte.