Documentation
¶
Index ¶
- func ConvertToXML(jsonStr string, newOpts ...ConvertToXMLOption) (string, error)
- func LoadFile(file string, v interface{}) error
- func LoadReader(reader io.Reader, v interface{}) error
- func SaveFile(file string, v interface{}) error
- func SaveFileIndent(file string, v interface{}, prefix, indent string) error
- func SaveWriter(writer io.Writer, v interface{}) error
- func SaveWriterIndent(writer io.Writer, v interface{}, prefix, indent string) error
- type ConvertToXMLOption
- type ConvertToXMLOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToXML ¶
func ConvertToXML(jsonStr string, newOpts ...ConvertToXMLOption) (string, error)
ConvertToXML converts json to xml
func LoadReader ¶
LoadReader loads json object from reader
func SaveFileIndent ¶
SaveFileIndent saves json object to a file with indent
func SaveWriter ¶
SaveWriter saves json object to a writer
Types ¶
type ConvertToXMLOption ¶
type ConvertToXMLOption func(*ConvertToXMLOptions) error
ConvertToXMLOption is a function on the options for a json2xml.
func WithIndent ¶
func WithIndent(withIndent bool, prefix, indent string) ConvertToXMLOption
WithIndent ...
func WithRootElementName ¶
func WithRootElementName(name string) ConvertToXMLOption
WithRootElementName ...
type ConvertToXMLOptions ¶
type ConvertToXMLOptions struct {
WithIndent bool // well formatted json
Prefix string // the json marshal prefix
Indent string // the json marshal indent
RootElementName string // the json root tag
}
ConvertToXMLOptions ...
func DefaultConvertToXMLOptions ¶
func DefaultConvertToXMLOptions() *ConvertToXMLOptions
DefaultConvertToXMLOptions ...
Click to show internal directories.
Click to hide internal directories.