enc

package module
v0.0.0-...-c4a66d0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2016 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package enc implements a very compact binary encoding for Go types. No type information is stored.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader, v interface{}) error

Decode reads data from r and unmarshals it. It panics if the value is of an invalid type.

func DecodeValue

func DecodeValue(r io.Reader, v reflect.Value) (err error)

DecodeValue reads data from r and unmarshals it. It panics if the value is of an invalid type.

func Encode

func Encode(w io.Writer, v interface{}) error

Encode marshals a value and writes it to w. It panics if the value is of an invalid type.

func EncodeValue

func EncodeValue(w io.Writer, v reflect.Value) (err error)

EncodeValue marshals a reflection value and writes it to w. It panics if the value is of an invalid type.

Types

type TypeError

type TypeError struct {
	T reflect.Type
}

A TypeError indicates that an invalid type was passed to De- or Encode.

func (TypeError) Error

func (t TypeError) Error() string

Jump to

Keyboard shortcuts

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