encoding

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2016 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const TagName = "gorethink"

Variables

This section is empty.

Functions

func Decode

func Decode(dst interface{}, src interface{}) (err error)

Decode decodes map[string]interface{} into a struct. The first parameter must be a pointer.

func Encode

func Encode(v interface{}) (ev interface{}, err error)

Encode returns the encoded value of v.

Encode traverses the value v recursively and looks for structs. If a struct is found then it is checked for tagged fields and convert to map[string]interface{}

func IgnoreType added in v0.5.0

func IgnoreType(t reflect.Type)

IgnoreType causes the encoder to ignore a type when encoding

Types

type DecodeTypeError

type DecodeTypeError struct {
	DestType, SrcType reflect.Type
	Reason            string
}

An InvalidTypeError describes a value that was not appropriate for a value of a specific Go type.

func (*DecodeTypeError) Error

func (e *DecodeTypeError) Error() string

type Error added in v0.5.0

type Error struct {
	Errors []string
}

Error implements the error interface and can represents multiple errors that occur in the course of a single decode.

func (*Error) Error added in v0.5.0

func (e *Error) Error() string

type InvalidUnmarshalError added in v0.6.0

type InvalidUnmarshalError struct {
	Type reflect.Type
}

func (*InvalidUnmarshalError) Error added in v0.6.0

func (e *InvalidUnmarshalError) Error() string

type Marshaler added in v0.5.0

type Marshaler interface {
	MarshalRQL() (interface{}, error)
}

Marshaler is the interface implemented by objects that can marshal themselves into a valid RQL psuedo-type.

type MarshalerError added in v0.5.0

type MarshalerError struct {
	Type reflect.Type
	Err  error
}

func (*MarshalerError) Error added in v0.5.0

func (e *MarshalerError) Error() string

type UnexpectedTypeError added in v0.6.0

type UnexpectedTypeError struct {
	DestType, SrcType reflect.Type
}

An UnsupportedTypeError is returned by Marshal when attempting to encode an unexpected value type.

func (*UnexpectedTypeError) Error added in v0.6.0

func (e *UnexpectedTypeError) Error() string

type Unmarshaler added in v0.5.0

type Unmarshaler interface {
	UnmarshalRQL(interface{}) error
}

Unmarshaler is the interface implemented by objects that can unmarshal a psuedo-type object of themselves.

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type reflect.Type
}

An UnsupportedTypeError is returned by Marshal when attempting to encode an unsupported value type.

func (*UnsupportedTypeError) Error

func (e *UnsupportedTypeError) Error() string

type UnsupportedValueError

type UnsupportedValueError struct {
	Value reflect.Value
	Str   string
}

func (*UnsupportedValueError) Error

func (e *UnsupportedValueError) Error() string

Jump to

Keyboard shortcuts

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