ebml

package
v0.0.0-...-90d4239 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ebml implements an encoder for EBML.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binary

type Binary []byte

func (Binary) Size

func (b Binary) Size() int

func (Binary) Write

func (b Binary) Write(w io.Writer) error

type Date

type Date struct{}

type Element

type Element struct {
	Class    uint64
	Children []Object
}

func CRC32

func CRC32(children ...Object) Element

func DocType

func DocType(children ...Object) Element

func DocTypeReadVersion

func DocTypeReadVersion(children ...Object) Element

func DocTypeVersion

func DocTypeVersion(children ...Object) Element

func EBML

func EBML(children ...Object) Element

func EBMLMaxIDLength

func EBMLMaxIDLength(children ...Object) Element

func EBMLMaxSizeLength

func EBMLMaxSizeLength(children ...Object) Element

func EBMLReadVersion

func EBMLReadVersion(children ...Object) Element

func EBMLVersion

func EBMLVersion(children ...Object) Element

func Signature

func Signature(children ...Object) Element

func SignatureAlgo

func SignatureAlgo(children ...Object) Element

func SignatureElementList

func SignatureElementList(children ...Object) Element

func SignatureElements

func SignatureElements(children ...Object) Element

func SignatureHash

func SignatureHash(children ...Object) Element

func SignaturePublicKey

func SignaturePublicKey(children ...Object) Element

func SignatureSlot

func SignatureSlot(children ...Object) Element

func SignedElement

func SignedElement(children ...Object) Element

func Void

func Void(children ...Object) Element

func (Element) Size

func (e Element) Size() int

func (Element) Write

func (e Element) Write(w io.Writer) error

type ElementID

type ElementID func(children ...Object) Element

type Encoder

type Encoder struct {
	Err error
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Emit

func (e *Encoder) Emit(obj Object) error

Emit writes the object and all of its possible children. It calculates the size automatically.

func (*Encoder) EmitHeader

func (e *Encoder) EmitHeader(class ElementID, size int) (Reference, error)

EmitHeader writes an element header with the given ID and size. If the size is negative, the special "unknown" size will be used instead.

func (*Encoder) Position

func (e *Encoder) Position() int

type Float

type Float float64 // XXX what about 10 bytes?

func (Float) Size

func (f Float) Size() int

func (Float) Write

func (f Float) Write(w io.Writer) error

type Int

type Int int64

func (Int) Size

func (i Int) Size() int

XXX return minimal sizes

func (Int) Write

func (i Int) Write(w io.Writer) error

XXX write minimal versions

type Object

type Object interface {
	Size() int
	Write(w io.Writer) error
}

type Padding

type Padding int

func (Padding) Size

func (p Padding) Size() int

func (Padding) Write

func (p Padding) Write(w io.Writer) error

type Reference

type Reference struct {
	ID   int
	Size int
	Data int
}

type String

type String string

func (String) Size

func (s String) Size() int

func (String) Write

func (s String) Write(w io.Writer) error

type UTF8

type UTF8 string

func (UTF8) Size

func (u UTF8) Size() int

func (UTF8) Write

func (u UTF8) Write(w io.Writer) error

type Uint

type Uint uint64

func (Uint) Size

func (u Uint) Size() int

func (Uint) Write

func (u Uint) Write(w io.Writer) error

type Varint

type Varint uint64

func (Varint) Length

func (v Varint) Length() int

func (Varint) Write

func (v Varint) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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