# README
dencoding - Dasel Encoding
This package provides encoding implementations for all supported file formats.
The main difference is that it aims to keep maps ordered, where the default encoders/decoders do not.
Support formats
Decoding
Custom decoders are required to ensure that map/object values are decoded into the Map
type rather than a standard map[string]any
.
Encoding
The Map
type must have the appropriate Marshal func on it to ensure marshalling it in the desired format retains the ordering.
# Functions
FromMap creates a *Map from the input map.
JSONEncodeIndent sets the indentation when encoding JSON.
JSONEscapeHTML enables or disables html escaping when encoding JSON.
NewJSONDecoder returns a new dencoding JSONDecoder.
NewJSONEncoder returns a new dencoding JSONEncoder.
NewMap returns a new *Map that has its values initialised.
NewTOMLDecoder returns a new dencoding TOMLDecoder.
NewTOMLEncoder returns a new dencoding TOMLEncoder.
NewYAMLDecoder returns a new dencoding YAMLDecoder.
NewYAMLEncoder returns a new dencoding YAMLEncoder.
TOMLIndentSymbol sets the indentation when encoding TOML.
YAMLEncodeIndent sets the indentation when encoding YAML.
# Structs
JSONDecoder wraps a standard json encoder to implement custom ordering logic.
JSONEncoder wraps a standard json encoder to implement custom ordering logic.
KeyValue is a single key value pair from a *Map.
Map is a map implementation that maintains ordering of keys.
TOMLDecoder wraps a standard toml encoder to implement custom ordering logic.
TOMLEncoder wraps a standard toml encoder to implement custom ordering logic.
YAMLDecoder wraps a standard yaml encoder to implement custom ordering logic.
YAMLEncoder wraps a standard yaml encoder to implement custom ordering logic.
# Interfaces
JSONDecoderOption is identifies an option that can be applied to a JSON decoder.
JSONEncoderOption is identifies an option that can be applied to a JSON encoder.
TOMLDecoderOption is identifies an option that can be applied to a TOML decoder.
TOMLEncoderOption is identifies an option that can be applied to a TOML encoder.
YAMLDecoderOption is identifies an option that can be applied to a YAML decoder.
YAMLEncoderOption is identifies an option that can be applied to a YAML encoder.