package encoding
import "gopkg.in/rethinkdb/rethinkdb-go.v6/encoding"
Index ¶
- Constants
- Variables
- func Decode(dst interface{}, src interface{}) (err error)
- func Encode(v interface{}) (ev interface{}, err error)
- func IgnoreType(t reflect.Type)
- func Merge(dst interface{}, src interface{}) (err error)
- func SetTypeEncoding( t reflect.Type, encode func(value interface{}) (interface{}, error), decode func(encoded interface{}, value reflect.Value) error, )
- type DecodeTypeError
- type Error
- type InvalidUnmarshalError
- type Marshaler
- type MarshalerError
- type UnexpectedTypeError
- type Unmarshaler
- type UnsupportedTypeError
- type UnsupportedValueError
Constants ¶
const ( TagName = "rethinkdb" OldTagName = "gorethink" JSONTagName = "json" RefTagName = "rethinkdb_ref" OldRefTagName = "gorethink_ref" )
Variables ¶
var ( Tags []string )
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 ¶
IgnoreType causes the encoder to ignore a type when encoding
func Merge ¶
func Merge(dst interface{}, src interface{}) (err error)
func SetTypeEncoding ¶
func SetTypeEncoding( t reflect.Type, encode func(value interface{}) (interface{}, error), decode func(encoded interface{}, value reflect.Value) error, )
Types ¶
type DecodeTypeError ¶
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 ¶
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 ¶
type InvalidUnmarshalError ¶
func (*InvalidUnmarshalError) Error ¶
func (e *InvalidUnmarshalError) Error() string
type Marshaler ¶
type Marshaler interface { MarshalRQL() (interface{}, error) }
Marshaler is the interface implemented by objects that can marshal themselves into a valid RQL pseudo-type.
type MarshalerError ¶
func (*MarshalerError) Error ¶
func (e *MarshalerError) Error() string
type UnexpectedTypeError ¶
An UnsupportedTypeError is returned by Marshal when attempting to encode an unexpected value type.
func (*UnexpectedTypeError) Error ¶
func (e *UnexpectedTypeError) Error() string
type Unmarshaler ¶
type Unmarshaler interface { UnmarshalRQL(interface{}) error }
Unmarshaler is the interface implemented by objects that can unmarshal a pseudo-type object of themselves.
type UnsupportedTypeError ¶
An UnsupportedTypeError is returned by Marshal when attempting to encode an unsupported value type.
func (*UnsupportedTypeError) Error ¶
func (e *UnsupportedTypeError) Error() string
type UnsupportedValueError ¶
func (*UnsupportedValueError) Error ¶
func (e *UnsupportedValueError) Error() string
Source Files ¶
cache.go decoder.go decoder_types.go encoder.go encoder_types.go encoding.go errors.go fold.go tags.go utils.go
- Version
- v6.2.2 (latest)
- Published
- Jun 2, 2022
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 1 week ago –
Tools for package owners.