jsonutil

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package jsonutil provides some helper functions for working with JSON objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

type JSON struct {
	// contains filtered or unexported fields
}

JSON object

func DecodeBuffer

func DecodeBuffer(data []byte) (*JSON, error)

DecodeBuffer - parse JSON data into a map-object data: input data

func DecodeObject

func DecodeObject(obj interface{}, r io.ReadCloser) (*JSON, error)

DecodeObject JSON data into a Go object and map-object A Go object has no method to check if the property was actually specified in JSON or not,

but a map-object provides this functionality.

Note: not suitable for a large data obj: target object r: input data (reader object)

func DecodeObjectBuffer

func DecodeObjectBuffer(obj interface{}, data []byte) (*JSON, error)

DecodeObjectBuffer - parse JSON data into a Go object and map-object obj: target object data: input data

func (*JSON) Exists

func (j *JSON) Exists(key string) bool

Exists returns TRUE if a key was specified in JSON source data

Jump to

Keyboard shortcuts

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