Documentation
¶
Overview ¶
Package xml2json is an XML to JSON converter
Index ¶
- func Convert(r io.Reader, ps ...plugin) (*bytes.Buffer, error)
- func ExcludeAttributes(attrs []string) *excluder
- func IncludeNSPrefix(v bool) *includeNSPrefix
- func IncludeXMLSequence(v bool) *includeXMLSequence
- func NodePlugin(path string, plugin nodePlugin) nodeFormatter
- func ToArray() *arrayFormatter
- func WithAttrPrefix(prefix string) *attrPrefixer
- func WithContentPrefix(prefix string) *contentPrefixer
- func WithNodes(n ...nodeFormatter) *nodesFormatter
- func WithTypeConverter(ts ...JSType) *customTypeConverter
- type Decoder
- func (dec *Decoder) AddFormatters(formatters []nodeFormatter)
- func (dec *Decoder) Decode(root *Node) error
- func (dec *Decoder) DecodeWithCustomPrefixes(root *Node, contentPrefix string, attributePrefix string) error
- func (dec *Decoder) ExcludeAttributes(attrs []string)
- func (dec *Decoder) IncludeXMLSequence(v bool)
- func (dec *Decoder) SetAttributePrefix(prefix string)
- func (dec *Decoder) SetContentPrefix(prefix string)
- func (dec *Decoder) SetIncludePrefix(prefix string)
- func (dec *Decoder) SetSequencePrefix(prefix string)
- type Encoder
- type JSType
- type Node
- type Nodes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExcludeAttributes ¶
func ExcludeAttributes(attrs []string) *excluder
func IncludeNSPrefix ¶
func IncludeNSPrefix(v bool) *includeNSPrefix
func IncludeXMLSequence ¶
func IncludeXMLSequence(v bool) *includeXMLSequence
func NodePlugin ¶
func NodePlugin(path string, plugin nodePlugin) nodeFormatter
func WithAttrPrefix ¶
func WithAttrPrefix(prefix string) *attrPrefixer
func WithContentPrefix ¶
func WithContentPrefix(prefix string) *contentPrefixer
func WithTypeConverter ¶
func WithTypeConverter(ts ...JSType) *customTypeConverter
Types ¶
type Decoder ¶
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
func (*Decoder) AddFormatters ¶
func (dec *Decoder) AddFormatters(formatters []nodeFormatter)
func (*Decoder) Decode ¶
Decode reads the next JSON-encoded value from its input and stores it in the value pointed to by v.
func (*Decoder) DecodeWithCustomPrefixes ¶
func (*Decoder) ExcludeAttributes ¶
func (*Decoder) IncludeXMLSequence ¶
func (*Decoder) SetAttributePrefix ¶
func (*Decoder) SetContentPrefix ¶
func (*Decoder) SetIncludePrefix ¶
func (*Decoder) SetSequencePrefix ¶
type JSType ¶
type JSType int
https://cswr.github.io/JsonSchema/spec/basic_types/ JSType is a JavaScript extracted from a string
func Str2JSType ¶
Str2JSType extract a JavaScript type from a string
Click to show internal directories.
Click to hide internal directories.