tlv

package
v0.0.0-...-7a2ab09 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidClass      = ParserError{"invalid class", 0}
	ErrInvalidObjectKind = ParserError{"invalid object kind", 0}
	ErrUnexpectedEOF     = ParserError{"unexpected EOF", 0}
	ErrInconsistentSize  = ParserError{"inconsistent size %d", 0}
)

Functions

This section is empty.

Types

type ConstructedEntry

type ConstructedEntry struct {
	MetaEntry
	Primitives  []PrimitiveEntry
	Constructed []ConstructedEntry
	// contains filtered or unexported fields
}

func (*ConstructedEntry) Next

func (c *ConstructedEntry) Next() (*GenericEntry, bool, error)

func (*ConstructedEntry) ResetCursor

func (c *ConstructedEntry) ResetCursor()

type EntryKind

type EntryKind byte
const (
	KindConstructed EntryKind = 1 << iota
	KindPrimitive
	ClassUniversal
	ClassApplication
	ClassContextSpecific
	ClassPrivate
	HasExtendedTag
	IsPDOL
)

type GenericEntry

type GenericEntry struct {
	Kind  EntryKind
	Value interface{}
}

func (GenericEntry) AsConstructed

func (g GenericEntry) AsConstructed() ConstructedEntry

func (GenericEntry) AsMeta

func (g GenericEntry) AsMeta() *MetaEntry

func (*GenericEntry) AsPrimitive

func (g *GenericEntry) AsPrimitive() PrimitiveEntry

type MetaEntry

type MetaEntry struct {
	TagBytes    []byte
	TagInfo     *meta.TagInfo
	Kind        EntryKind
	ValueLength uint64
	// contains filtered or unexported fields
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(reader io.Reader, isPDOL bool) (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse() ([]*GenericEntry, error)

type ParserError

type ParserError struct {
	// contains filtered or unexported fields
}

func (ParserError) Error

func (e ParserError) Error() string

type PrimitiveEntry

type PrimitiveEntry struct {
	MetaEntry
	Value       []byte
	ValueLength uint64
}

Jump to

Keyboard shortcuts

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