xmlq

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

xmlq

GoDoc Build Status Coverage Status Go Report Card Apache 2 License

xmlq is a Go library for pretty printing xml and masking element values. XML inside of CDATA stanzas is also masked and indented.

Usage

import (
	"github.com/adamdecaf/xmlq/pkg/xmlq"
)

var (
	xmlData io.Reader
)

output, err := xmlq.MarshalIndent(xmlData, &Options{
	Indent: "  ", // two spaces
	Masks: []Mask{
		{
			// <ct:Id>11000179512199001</ct:Id>
			Name: "Id",
			Mask: ShowLastFour,
		},
		{
			// <ct:Nm>John Doe</ct:Nm>
			Name: "Nm",
			Mask: ShowWordStart,
		},
	},
})

Supported and tested platforms

  • 64-bit Linux (Ubuntu, Debian), macOS, and Windows

License

Apache License 2.0 - See LICENSE for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL