jsonutils

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package jsonutils implements JSON utility functions.

Index

Constants

View Source
const (
	ColorReset  = "\033[0m"
	ColorBold   = "\033[1m"
	ColorRed    = "\033[31m"
	ColorGreen  = "\033[32m"
	ColorYellow = "\033[33m"
	ColorBlue   = "\033[34m"
	ColorPurple = "\033[35m"
	ColorCyan   = "\033[36m"
	ColorGray   = "\033[37m"
)

ANSI color codes for terminal output.

Variables

This section is empty.

Functions

func Format

func Format(data any, format string) (string, error)

Format formats the given data according to the specified output format.

func NormalizeParameterType added in v0.2.2

func NormalizeParameterType(typeName string) string

NormalizeParameterType converts common type names to their canonical form. This is used to accept alternative type names (like "str" for "string").

Types

type OutputFormat

type OutputFormat string

OutputFormat represents the available output format options.

const (
	FormatJSON   OutputFormat = "json"
	FormatPretty OutputFormat = "pretty"
	FormatTable  OutputFormat = "table"
)

constants.

func ParseFormat

func ParseFormat(format string) OutputFormat

ParseFormat converts a string to an OutputFormat.

Jump to

Keyboard shortcuts

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