Documentation ¶
Overview ¶
Package edn implements encoding and decoding of EDN values as defined in https://github.com/edn-format/edn
The mapping between EDN and Go values is described in the documentation for the Marshal and Unmarshal functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshal returns the EDN encoding of v.
Marshal traverses the value v recursively, using the following type-dependent default encodings: (see https://github.com/edn-format/edn)
func MustMarshal ¶
func MustMarshal(v interface{}) []byte
MustMarshal is a panicky version of Marshal.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder writes EDN objects to an output stream.
func NewEncoder ¶
NewEncoder returns a new encoder that writes to w.
type KMap ¶
type KMap map[string]interface{}
KMap is useful for generating EDN maps with Keywords as keys. For example: Marshal(KMap{"foo": 45, "bar": 3.14}) => {:foo 45, :bar 3.14}
type MarshalerError ¶
func (*MarshalerError) Error ¶
func (e *MarshalerError) Error() string
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