Documentation ¶
Index ¶
- func ConvertToJSON(xmlStr string, newOpts ...ConvertToJSONOption) (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 ConvertToJSONOption
- type ConvertToJSONOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToJSON ¶
func ConvertToJSON(xmlStr string, newOpts ...ConvertToJSONOption) (string, error)
ConvertToJSON converts from xml to json
func LoadReader ¶
LoadReader loads xml object from reader
func SaveFileIndent ¶
SaveFileIndent saves xml object to a file with indent
func SaveWriter ¶
SaveWriter saves xml object to a writer
Types ¶
type ConvertToJSONOption ¶
type ConvertToJSONOption func(*ConvertToJSONOptions) error
ConvertToJSONOption is a function on the options for a xml2json.
func WithIndent ¶
func WithIndent(withIndent bool, prefix, indent string) ConvertToJSONOption
WithIndent ...
type ConvertToJSONOptions ¶
type ConvertToJSONOptions struct { WithIndent bool // well formatted json Prefix string // the json marshal prefix Indent string // the json marshal indent WithRootElement bool // with the root element }
ConvertToJSONOptions ...
func DefaultConvertToJSONOptions ¶
func DefaultConvertToJSONOptions() *ConvertToJSONOptions
DefaultConvertToJSONOptions ...
Click to show internal directories.
Click to hide internal directories.