pretty

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package pretty contains functions for prettifying and visualizing data in JSON and YAML formats. It includes support for masking sensitive fields when outputting data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(obj any) string

JSON returns a prettified JSON representation of the provided object.

func JSONMasked

func JSONMasked(obj any) string

JSONMasked returns a prettified JSON representation of the provided object with masked sensitive fields.

func MaskJSON

func MaskJSON(obj any) any

MaskJSON masks sensitive fields in the provided object according to predefined masking rules and returns the masked object. The masker replaces sensitive data with a mask character.

func PrintJSON

func PrintJSON(obj any)

PrintJSON prints a prettified JSON representation of the provided object.

func PrintJSONMasked

func PrintJSONMasked(obj any)

PrintJSONMasked prints a prettified JSON representation of the provided object with masked sensitive fields. It uses MaskJSON internally to mask the fields.

func PrintYAML

func PrintYAML(obj any)

PrintYAML prints a prettified YAML representation of the provided object.

func PrintYAMLMasked

func PrintYAMLMasked(obj any)

PrintYAMLMasked prints a prettified YAML representation of the provided object with masked sensitive fields. It uses MaskYAML internally to mask the fields.

func YAML

func YAML(obj any) string

YAML returns a prettified YAML representation of the provided object.

func YAMLMasked

func YAMLMasked(obj any) string

YAMLMasked returns a prettified YAML representation of the provided object with masked sensitive fields. It uses JSONMasked internally to mask the fields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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