xmlq

package
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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalIndent

func MarshalIndent(input io.Reader, opts *Options) ([]byte, error)

MarshalIndent will unmarshal and remarshal XML with specified element values masked. Masking matches on element names and applying the masking logic specified.

The XML is not remarshaled exactly as it arrives.

  • Self-closing elements are expanded into start and end tags.
  • Namespace prefixes are generally preserved, but namespace attributes may appear in the output.
  • Certain characters are escaped with their xml entity values.

Types

type Mask

type Mask struct {
	Name, Space string

	Mask MaskingType
}

type MaskingType

type MaskingType string
var (
	ShowLastFour  MaskingType = "show-last-four"
	ShowMiddle    MaskingType = "show-middle"
	ShowWordStart MaskingType = "show-word-start"
	ShowNone      MaskingType = "show-none"
)

type Options

type Options struct {
	Prefix, Indent string

	Masks []Mask
}

Jump to

Keyboard shortcuts

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