jsonhelper

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package jsonhelper provides helper methods for working with JSON

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToJSONBuffer

func ConvertToJSONBuffer(b interface{}) (*bytes.Buffer, error)

Converts any object into a JSON representation, returned in a buffer

func ConvertToJSONString

func ConvertToJSONString(
	in interface{},
	prettyPrint bool,
) (string, error)

func CreateJSONLogMessage

func CreateJSONLogMessage(message string, jsonString string) string

JSONToLogMessage logs a json string with pretty format with a message

func IsJSONString

func IsJSONString(s string) bool

IsJSONString determines whether a string is JSON

func PrintPrettyJSON

func PrintPrettyJSON(in string) (string, error)

Returns a nicely formatted copy of a JSON string

func ShowAsJSON

func ShowAsJSON(objName string, body interface{}) string

ShowAsJSON shows obj in json pretty format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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