vom

package
v0.0.0-...-e3ab1ac Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package vom implements the Vanadium Object Marshaling serialization format.

Concept: https://vanadium.github.io/concepts/rpc.html#vom
Specification: https://vanadium.github.io/designdocs/vom-spec.html

VOM supports serialization of all types representable by v.io/v23/vdl, and is a self-describing format that retains full type information. It is the underlying serialization format used by v.io/v23/rpc.

The API is almost identical to encoding/gob. To marshal objects create an Encoder and present it with a series of values. To unmarshal objects create a Decoder and retrieve values. The implementation creates a stream of messages between the Encoder and Decoder.

Index

Constants

View Source
const (
	Version80 = Version(0x80)
	Version81 = Version(0x81)

	DefaultVersion = Version81
)
View Source
const WireCtrlEnd = byte(225) // End of struct or union
View Source
const WireCtrlNil = byte(224) // Nil in optional or any
View Source
const WireCtrlTypeIncomplete = byte(226) // Marks that the type message is incomplete until future messages are received
View Source
const WireIdAny = TypeId(15)
View Source
const WireIdBool = TypeId(1)

Primitive types.

View Source
const WireIdByte = TypeId(2)
View Source
const WireIdByteList = TypeId(39)

Other commonly used composites.

View Source
const WireIdFirstUserType = TypeId(41)

The first user-defined TypeId is 41.

View Source
const WireIdFloat32 = TypeId(10)
View Source
const WireIdFloat64 = TypeId(11)
View Source
const WireIdInt16 = TypeId(7)
View Source
const WireIdInt32 = TypeId(8)
View Source
const WireIdInt64 = TypeId(9)
View Source
const WireIdInt8 = TypeId(16)
View Source
const WireIdString = TypeId(3)
View Source
const WireIdStringList = TypeId(40)
View Source
const WireIdTypeObject = TypeId(14)

Wire ids 12 and 13 were previously used for complex64 and complex 128.

View Source
const WireIdUint16 = TypeId(4)
View Source
const WireIdUint32 = TypeId(5)
View Source
const WireIdUint64 = TypeId(6)

Variables

ControlKindAll holds all labels for ControlKind.

DumpKindAll holds all labels for DumpKind.

Functions

func Decode

func Decode(data []byte, v interface{}) error

Decode reads the value from the given data, and stores it in value v. The semantics of value decoding are described by Decoder.Decode.

This is a "single-shot" decoding; the data must have been encoded by a call to vom.Encode.

func Dump

func Dump(data []byte) (string, error)

Dump returns a human-readable dump of the given vom data, in the default string format.

func Encode

func Encode(v interface{}) ([]byte, error)

Encode writes the value v and returns the encoded bytes. The semantics of value encoding are described by Encoder.Encode.

This is a "single-shot" encoding; full type information is always included in the returned encoding, as if a new encoder were used for each call.

func VDLReadPrimitive

func VDLReadPrimitive(dec vdl.Decoder, x *Primitive) error

func VersionedEncode

func VersionedEncode(version Version, v interface{}) ([]byte, error)

VersionedEncode performs single-shot encoding to a specific version of VOM

Types

type ControlKind

type ControlKind int

ControlKind enumerates the different kinds of control bytes.

const (
	ControlKindNil ControlKind = iota
	ControlKindEnd
	ControlKindIncompleteType
)

func ControlKindFromString

func ControlKindFromString(label string) (x ControlKind, err error)

ControlKindFromString creates a ControlKind from a string label.

func (*ControlKind) FillVDLTarget

func (m *ControlKind) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*ControlKind) MakeVDLTarget

func (m *ControlKind) MakeVDLTarget() vdl.Target

func (*ControlKind) Set

func (x *ControlKind) Set(label string) error

Set assigns label to x.

func (ControlKind) String

func (x ControlKind) String() string

String returns the string label of x.

func (ControlKind) VDLIsZero

func (x ControlKind) VDLIsZero() bool

func (*ControlKind) VDLRead

func (x *ControlKind) VDLRead(dec vdl.Decoder) error

func (ControlKind) VDLWrite

func (x ControlKind) VDLWrite(enc vdl.Encoder) error

type ControlKindTarget

type ControlKindTarget struct {
	Value *ControlKind
	vdl.TargetBase
}

func (*ControlKindTarget) FromEnumLabel

func (t *ControlKindTarget) FromEnumLabel(src string, tt *vdl.Type) error

type Decoder

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

Decoder manages the receipt and unmarshalling of typed values from the other side of a connection.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder returns a new Decoder that reads from the given reader. The Decoder understands all formats generated by the Encoder.

func NewDecoderWithTypeDecoder

func NewDecoderWithTypeDecoder(r io.Reader, typeDec *TypeDecoder) *Decoder

NewDecoderWithTypeDecoder returns a new Decoder that reads from the given reader. Types will be decoded separately through the given typeDec.

func (*Decoder) Decode

func (d *Decoder) Decode(v interface{}) error

Decode reads the next value from the reader(s) and stores it in value v. The type of v need not exactly match the type of the originally encoded value; decoding succeeds as long as the values are compatible.

Types that are special-cased, only for v:
  *RawBytes  - Store raw (uninterpreted) bytes in v.

Types that are special-cased, recursively throughout v:
  *vdl.Value    - Decode into v.
  reflect.Value - Decode into v, which must be settable.

Decoding into a RawBytes captures the value in a raw form, which may be subsequently passed to an Encoder for transcoding.

Decode(nil) always returns an error. Use Ignore() to ignore the next value.

func (*Decoder) Ignore

func (d *Decoder) Ignore() error

Ignore ignores the next value from the reader.

type DumpAtom

type DumpAtom struct {
	Kind  DumpKind  // The kind of this atom.
	Bytes []byte    // Raw bytes in the vom encoding representing this atom.
	Data  Primitive // Primitive data corresponding to the raw bytes.
	Debug string    // Free-form debug string with more information.
}

DumpAtom describes a single indivisible piece of the vom encoding. The vom encoding is composed of a stream of these atoms.

func (*DumpAtom) FillVDLTarget

func (m *DumpAtom) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*DumpAtom) MakeVDLTarget

func (m *DumpAtom) MakeVDLTarget() vdl.Target

func (DumpAtom) String

func (a DumpAtom) String() string

func (DumpAtom) VDLIsZero

func (x DumpAtom) VDLIsZero() bool

func (*DumpAtom) VDLRead

func (x *DumpAtom) VDLRead(dec vdl.Decoder) error

func (DumpAtom) VDLWrite

func (x DumpAtom) VDLWrite(enc vdl.Encoder) error

type DumpAtomTarget

type DumpAtomTarget struct {
	Value *DumpAtom

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*DumpAtomTarget) FinishField

func (t *DumpAtomTarget) FinishField(_, _ vdl.Target) error

func (*DumpAtomTarget) FinishFields

func (t *DumpAtomTarget) FinishFields(_ vdl.FieldsTarget) error

func (*DumpAtomTarget) StartField

func (t *DumpAtomTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*DumpAtomTarget) StartFields

func (t *DumpAtomTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*DumpAtomTarget) ZeroField

func (t *DumpAtomTarget) ZeroField(name string) error

type DumpKind

type DumpKind int

DumpKind enumerates the different kinds of dump atoms.

const (
	DumpKindVersion DumpKind = iota
	DumpKindControl
	DumpKindMsgId
	DumpKindTypeMsg
	DumpKindValueMsg
	DumpKindMsgLen
	DumpKindAnyMsgLen
	DumpKindAnyLensLen
	DumpKindTypeIdsLen
	DumpKindTypeId
	DumpKindPrimValue
	DumpKindByteLen
	DumpKindValueLen
	DumpKindIndex
	DumpKindWireTypeIndex
)

func DumpKindFromString

func DumpKindFromString(label string) (x DumpKind, err error)

DumpKindFromString creates a DumpKind from a string label.

func (*DumpKind) FillVDLTarget

func (m *DumpKind) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*DumpKind) MakeVDLTarget

func (m *DumpKind) MakeVDLTarget() vdl.Target

func (*DumpKind) Set

func (x *DumpKind) Set(label string) error

Set assigns label to x.

func (DumpKind) String

func (x DumpKind) String() string

String returns the string label of x.

func (DumpKind) VDLIsZero

func (x DumpKind) VDLIsZero() bool

func (*DumpKind) VDLRead

func (x *DumpKind) VDLRead(dec vdl.Decoder) error

func (DumpKind) VDLWrite

func (x DumpKind) VDLWrite(enc vdl.Encoder) error

type DumpKindTarget

type DumpKindTarget struct {
	Value *DumpKind
	vdl.TargetBase
}

func (*DumpKindTarget) FromEnumLabel

func (t *DumpKindTarget) FromEnumLabel(src string, tt *vdl.Type) error

type DumpStatus

type DumpStatus struct {
	MsgId      int64
	MsgLen     int
	MsgN       int
	Buf        []byte
	Debug      string
	RefTypes   []*vdl.Type
	RefAnyLens []uint64
	Value      *vdl.Value
	Err        error
}

DumpStatus represents the state of the dumper. It is written to the DumpWriter at the end of decoding each value, and may also be triggered explicitly via Dumper.Status calls to get information for partial dumps.

func (DumpStatus) String

func (s DumpStatus) String() string

type DumpWriter

type DumpWriter interface {
	// WriteAtom is called by the Dumper for each atom it decodes.
	WriteAtom(atom DumpAtom)
	// WriteStatus is called by the Dumper to indicate the status of the dumper.
	WriteStatus(status DumpStatus)
}

DumpWriter is the interface that describes how to write out dumps produced by the Dumper. Implement this interface to customize dump output behavior.

func NewDumpWriter

func NewDumpWriter(w io.Writer) DumpWriter

NewDumpWriter returns a DumpWriter that outputs dumps to w, writing each atom and status on its own line, in their default string format.

type Dumper

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

Dumper produces dumps of vom data. It implements the io.WriteCloser interface; Data is fed to the dumper via Write, and Close must be called at the end of usage to release resources.

Dumps of vom data consist of a single stream of DumpAtom and DumpStatus. Each atom describes a single piece of the vom encoding; the vom encoding is composed of a stream of atoms. The status describes the state of the dumper at that point in the stream.

func NewDumper

func NewDumper(w DumpWriter) *Dumper

NewDumper returns a new Dumper, which writes dumps of vom data to w.

Close must be called on the returned Dumper to release resources.

func (*Dumper) Close

func (d *Dumper) Close() error

Close flushes buffered data and releases resources. Close must be called exactly once, when the dumper is no longer needed.

func (*Dumper) Flush

func (d *Dumper) Flush() error

Flush flushes buffered data, and causes the dumper to restart decoding at the start of a new message. This is useful if the previous data in the stream was corrupt, and subsequent data will be for new vom messages. Previously buffered type information remains intact.

func (*Dumper) Status

func (d *Dumper) Status()

Status triggers an explicit dump of the current status of the dumper to the DumpWriter. Status is normally generated at the end of each each decoded message; call Status to get extra information for partial dumps and errors.

func (*Dumper) Write

func (d *Dumper) Write(data []byte) (int, error)

Write implements the io.Writer interface method. This is the mechanism by which data is fed into the dumper.

type Encoder

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

Encoder manages the transmission and marshaling of typed values to the other side of a connection.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new Encoder that writes to the given writer in the binary format. The binary format is compact and fast.

func NewEncoderWithTypeEncoder

func NewEncoderWithTypeEncoder(w io.Writer, typeEnc *TypeEncoder) *Encoder

NewEncoderWithTypeEncoder returns a new Encoder that writes to the given writer in the binary format. Types will be encoded separately through the given typeEncoder.

func NewVersionedEncoder

func NewVersionedEncoder(version Version, w io.Writer) *Encoder

NewVersionedEncoder returns a new Encoder that writes to the given writer with the specified VOM version.

func NewVersionedEncoderWithTypeEncoder

func NewVersionedEncoderWithTypeEncoder(version Version, w io.Writer, typeEnc *TypeEncoder) *Encoder

NewVersionedEncoderWithTypeEncoder returns a new Encoder that writes to the given writer in the binary format. Types will be encoded separately through the given typeEncoder.

func (*Encoder) Encode

func (e *Encoder) Encode(v interface{}) error

Encode transmits the value v. Values of type T are encodable as long as the type of T is representable as val.Type, or T is special-cased below; otherwise an error is returned.

Types that are special-cased, only for v:
  *RawBytes     - Transcode v into the appropriate output format.

Types that are special-cased, recursively throughout v:
  *vdl.Value    - Encode the semantic value represented by v.
  reflect.Value - Encode the semantic value represented by v.

Encode(nil) is a special case that encodes the zero value of the any type. See the discussion of zero values in the Value documentation.

type Primitive

type Primitive interface {
	// Index returns the field index.
	Index() int
	// Interface returns the field value as an interface.
	Interface() interface{}
	// Name returns the field name.
	Name() string

	FillVDLTarget(vdl.Target, *vdl.Type) error
	VDLIsZero() bool
	VDLWrite(vdl.Encoder) error
	// contains filtered or unexported methods
}

Primitive represents any single field of the Primitive union type.

Primitive represents one of the primitive vom values. All vom values are composed of combinations of these primitives.

type PrimitivePBool

type PrimitivePBool struct{ Value bool }

PrimitivePBool represents field PBool of the Primitive union type.

func (PrimitivePBool) FillVDLTarget

func (m PrimitivePBool) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (PrimitivePBool) Index

func (x PrimitivePBool) Index() int

func (PrimitivePBool) Interface

func (x PrimitivePBool) Interface() interface{}

func (PrimitivePBool) MakeVDLTarget

func (m PrimitivePBool) MakeVDLTarget() vdl.Target

func (PrimitivePBool) Name

func (x PrimitivePBool) Name() string

func (PrimitivePBool) VDLIsZero

func (x PrimitivePBool) VDLIsZero() bool

func (PrimitivePBool) VDLWrite

func (x PrimitivePBool) VDLWrite(enc vdl.Encoder) error

type PrimitivePByte

type PrimitivePByte struct{ Value byte }

PrimitivePByte represents field PByte of the Primitive union type.

func (PrimitivePByte) FillVDLTarget

func (m PrimitivePByte) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (PrimitivePByte) Index

func (x PrimitivePByte) Index() int

func (PrimitivePByte) Interface

func (x PrimitivePByte) Interface() interface{}

func (PrimitivePByte) MakeVDLTarget

func (m PrimitivePByte) MakeVDLTarget() vdl.Target

func (PrimitivePByte) Name

func (x PrimitivePByte) Name() string

func (PrimitivePByte) VDLIsZero

func (x PrimitivePByte) VDLIsZero() bool

func (PrimitivePByte) VDLWrite

func (x PrimitivePByte) VDLWrite(enc vdl.Encoder) error

type PrimitivePControl

type PrimitivePControl struct{ Value ControlKind }

PrimitivePControl represents field PControl of the Primitive union type.

func (PrimitivePControl) FillVDLTarget

func (m PrimitivePControl) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (PrimitivePControl) Index

func (x PrimitivePControl) Index() int

func (PrimitivePControl) Interface

func (x PrimitivePControl) Interface() interface{}

func (PrimitivePControl) MakeVDLTarget

func (m PrimitivePControl) MakeVDLTarget() vdl.Target

func (PrimitivePControl) Name

func (x PrimitivePControl) Name() string

func (PrimitivePControl) VDLIsZero

func (x PrimitivePControl) VDLIsZero() bool

func (PrimitivePControl) VDLWrite

func (x PrimitivePControl) VDLWrite(enc vdl.Encoder) error

type PrimitivePFloat

type PrimitivePFloat struct{ Value float64 }

PrimitivePFloat represents field PFloat of the Primitive union type.

func (PrimitivePFloat) FillVDLTarget

func (m PrimitivePFloat) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (PrimitivePFloat) Index

func (x PrimitivePFloat) Index() int

func (PrimitivePFloat) Interface

func (x PrimitivePFloat) Interface() interface{}

func (PrimitivePFloat) MakeVDLTarget

func (m PrimitivePFloat) MakeVDLTarget() vdl.Target

func (PrimitivePFloat) Name

func (x PrimitivePFloat) Name() string

func (PrimitivePFloat) VDLIsZero

func (x PrimitivePFloat) VDLIsZero() bool

func (PrimitivePFloat) VDLWrite

func (x PrimitivePFloat) VDLWrite(enc vdl.Encoder) error

type PrimitivePInt

type PrimitivePInt struct{ Value int64 }

PrimitivePInt represents field PInt of the Primitive union type.

func (PrimitivePInt) FillVDLTarget

func (m PrimitivePInt) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (PrimitivePInt) Index

func (x PrimitivePInt) Index() int

func (PrimitivePInt) Interface

func (x PrimitivePInt) Interface() interface{}

func (PrimitivePInt) MakeVDLTarget

func (m PrimitivePInt) MakeVDLTarget() vdl.Target

func (PrimitivePInt) Name

func (x PrimitivePInt) Name() string

func (PrimitivePInt) VDLIsZero

func (x PrimitivePInt) VDLIsZero() bool

func (PrimitivePInt) VDLWrite

func (x PrimitivePInt) VDLWrite(enc vdl.Encoder) error

type PrimitivePString

type PrimitivePString struct{ Value string }

PrimitivePString represents field PString of the Primitive union type.

func (PrimitivePString) FillVDLTarget

func (m PrimitivePString) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (PrimitivePString) Index

func (x PrimitivePString) Index() int

func (PrimitivePString) Interface

func (x PrimitivePString) Interface() interface{}

func (PrimitivePString) MakeVDLTarget

func (m PrimitivePString) MakeVDLTarget() vdl.Target

func (PrimitivePString) Name

func (x PrimitivePString) Name() string

func (PrimitivePString) VDLIsZero

func (x PrimitivePString) VDLIsZero() bool

func (PrimitivePString) VDLWrite

func (x PrimitivePString) VDLWrite(enc vdl.Encoder) error

type PrimitivePUint

type PrimitivePUint struct{ Value uint64 }

PrimitivePUint represents field PUint of the Primitive union type.

func (PrimitivePUint) FillVDLTarget

func (m PrimitivePUint) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (PrimitivePUint) Index

func (x PrimitivePUint) Index() int

func (PrimitivePUint) Interface

func (x PrimitivePUint) Interface() interface{}

func (PrimitivePUint) MakeVDLTarget

func (m PrimitivePUint) MakeVDLTarget() vdl.Target

func (PrimitivePUint) Name

func (x PrimitivePUint) Name() string

func (PrimitivePUint) VDLIsZero

func (x PrimitivePUint) VDLIsZero() bool

func (PrimitivePUint) VDLWrite

func (x PrimitivePUint) VDLWrite(enc vdl.Encoder) error

type PrimitiveTarget

type PrimitiveTarget struct {
	Value *Primitive

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*PrimitiveTarget) FinishField

func (t *PrimitiveTarget) FinishField(_, fieldTarget vdl.Target) error

func (*PrimitiveTarget) FinishFields

func (t *PrimitiveTarget) FinishFields(_ vdl.FieldsTarget) error

func (*PrimitiveTarget) StartField

func (t *PrimitiveTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*PrimitiveTarget) StartFields

func (t *PrimitiveTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

type RawBytes

type RawBytes struct {
	Version    Version
	Type       *vdl.Type
	RefTypes   []*vdl.Type
	AnyLengths []int
	Data       []byte
}

func RawBytesFromValue

func RawBytesFromValue(value interface{}) (*RawBytes, error)

func RawBytesOf

func RawBytesOf(value interface{}) *RawBytes

func (*RawBytes) Decoder

func (rb *RawBytes) Decoder() vdl.Decoder

func (*RawBytes) FillVDLTarget

func (rb *RawBytes) FillVDLTarget(target vdl.Target, _ *vdl.Type) error

func (*RawBytes) IsNil

func (rb *RawBytes) IsNil() bool

func (*RawBytes) MakeVDLTarget

func (rb *RawBytes) MakeVDLTarget() vdl.Target

func (*RawBytes) String

func (rb *RawBytes) String() string

String outputs a string representation of RawBytes of the form RawBytes{Version81, int8, RefTypes{bool, string}, AnyLengths{4}, fa0e9dcc}

func (*RawBytes) ToValue

func (rb *RawBytes) ToValue(value interface{}) error

func (*RawBytes) VDLIsZero

func (rb *RawBytes) VDLIsZero() bool

func (*RawBytes) VDLRead

func (rb *RawBytes) VDLRead(dec vdl.Decoder) error

func (*RawBytes) VDLWrite

func (rb *RawBytes) VDLWrite(enc vdl.Encoder) error

type TypeDecoder

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

TypeDecoder manages the receipt and unmarshalling of types from the other side of a connection. Start must be called to start decoding types, and Stop must be called to reclaim resources.

func NewTypeDecoder

func NewTypeDecoder(r io.Reader) *TypeDecoder

NewTypeDecoder returns a new TypeDecoder that reads from the given reader. The TypeDecoder understands all wire type formats generated by the TypeEncoder.

func (*TypeDecoder) Start

func (d *TypeDecoder) Start()

Start must be called to start decoding types.

func (*TypeDecoder) Stop

func (d *TypeDecoder) Stop()

Stop must be called after Start, to stop decoding types and reclaim resources. Once Stop is called, subsequent Decode calls on Decoders initialized with d will return errors.

type TypeEncoder

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

TypeEncoder manages the transmission and marshaling of types to the other side of a connection.

func NewTypeEncoder

func NewTypeEncoder(w io.Writer) *TypeEncoder

NewTypeEncoder returns a new TypeEncoder that writes types to the given writer in the binary format.

func NewVersionedTypeEncoder

func NewVersionedTypeEncoder(version Version, w io.Writer) *TypeEncoder

NewTypeEncoderVersion returns a new TypeEncoder that writes types to the given writer in the specified VOM version.

type TypeId

type TypeId uint64

TypeId uniquely identifies a type definition within a vom stream.

func (*TypeId) FillVDLTarget

func (m *TypeId) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*TypeId) MakeVDLTarget

func (m *TypeId) MakeVDLTarget() vdl.Target

func (TypeId) VDLIsZero

func (x TypeId) VDLIsZero() bool

func (*TypeId) VDLRead

func (x *TypeId) VDLRead(dec vdl.Decoder) error

func (TypeId) VDLWrite

func (x TypeId) VDLWrite(enc vdl.Encoder) error

type TypeIdTarget

type TypeIdTarget struct {
	Value *TypeId
	vdl.TargetBase
}

func (*TypeIdTarget) FromFloat

func (t *TypeIdTarget) FromFloat(src float64, tt *vdl.Type) error

func (*TypeIdTarget) FromInt

func (t *TypeIdTarget) FromInt(src int64, tt *vdl.Type) error

func (*TypeIdTarget) FromUint

func (t *TypeIdTarget) FromUint(src uint64, tt *vdl.Type) error

type Version

type Version byte

func (Version) String

func (v Version) String() string

type XDecoder

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

func NewXDecoder

func NewXDecoder(r io.Reader) *XDecoder

func NewXDecoderWithTypeDecoder

func NewXDecoderWithTypeDecoder(r io.Reader, typeDec *TypeDecoder) *XDecoder

func (*XDecoder) Decode

func (d *XDecoder) Decode(v interface{}) error

func (*XDecoder) Decoder

func (d *XDecoder) Decoder() vdl.Decoder

func (*XDecoder) Ignore

func (d *XDecoder) Ignore() error

type XEncoder

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

func NewVersionedXEncoder

func NewVersionedXEncoder(version Version, w io.Writer) *XEncoder

func NewVersionedXEncoderWithTypeEncoder

func NewVersionedXEncoderWithTypeEncoder(version Version, w io.Writer, typeEnc *TypeEncoder) *XEncoder

func NewXEncoder

func NewXEncoder(w io.Writer) *XEncoder

func NewXEncoderWithTypeEncoder

func NewXEncoderWithTypeEncoder(w io.Writer, typeEnc *TypeEncoder) *XEncoder

func (*XEncoder) Encode

func (e *XEncoder) Encode(v interface{}) error

func (*XEncoder) Encoder

func (e *XEncoder) Encoder() vdl.Encoder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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