json

package
v0.0.0-...-e081c89 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package json is a custom json parser with an aim to provide more descriptive errors when reading malformed json

Index

Constants

View Source
const NoData = "no data returned"

NoData is a custom default error message when JSON marshaller returns nil

Variables

This section is empty.

Functions

func LazyLogging

func LazyLogging(v interface{}) string

func LazyLoggingPretty

func LazyLoggingPretty(v interface{}) string

func Marshal

func Marshal(v interface{}, isTTY bool) (b []byte, err error)

Marshal is a wrapper around Go's JSON marshaller to prettify output depending on whether the target is a terminal or not. This is so that the output is human readable when output for a human but a single line machine readable formatting for better support with iteration / concatenation when output to system functions.

func Unmarshal

func Unmarshal(data []byte, v interface{}) (err error)

Unmarshal is a wrapper around the standard json.Unmarshal function. This is done this way so that murex can swap out the JSON unmarshaller from the standard libraries with a 3rd party decoder that might run more efficiently.

func UnmarshalMurex

func UnmarshalMurex(data []byte, v interface{}) error

UnmarshalMurex is a wrapper around Go's JSON unmarshaller to support nested brace quotes (which allows for a cleaner syntax when embedding Murex code as JSON strings) and line comments via the hash, `#`, prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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