jsonutil

package
v0.0.0-...-17f76c2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package jsonutil helps with encoding/decoding data in json format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(data []byte, out interface{}) error

DecodeJSON -

func DecodeJSONFromReader

func DecodeJSONFromReader(r io.Reader, out interface{}) error

DecodeJSONFromReader - Decodes/Unmarshals the given io.Reader pointing to a JSON, into a desired object

func EncodeJSON

func EncodeJSON(in interface{}) ([]byte, error)

EncodeJSON - Encodes/Marshals the given object into JSON

func EncodeJSONToWriter

func EncodeJSONToWriter(w io.Writer, in interface{}, prefix, indent string) error

EncodeJSONToWriter - encodes/marshals a given interface to an io writer. it can also indent the output

func EncodeJSONWithIndentation

func EncodeJSONWithIndentation(in interface{}) ([]byte, error)

EncodeJSONWithIndentation - Encodes/Marshals the given object into JSON DEPRACATED

func EncodeJSONWithoutErr

func EncodeJSONWithoutErr(in interface{}) []byte

EncodeJSONWithoutErr - Encodes/Marshals the given object into JSON but does not return an err

Types

This section is empty.

Jump to

Keyboard shortcuts

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