json

package
Version: v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertInterfaceNumbers

func ConvertInterfaceNumbers(v *interface{}, depth int) error

ConvertInterfaceNumbers converts any json.Number values to int64 or float64. Values which are map[string]interface{} or []interface{} are recursively visited

func ConvertMapNumbers

func ConvertMapNumbers(m map[string]interface{}, depth int) error

ConvertMapNumbers traverses the map, converting any json.Number values to int64 or float64. values which are map[string]interface{} or []interface{} are recursively visited

func ConvertSliceNumbers

func ConvertSliceNumbers(s []interface{}, depth int) error

ConvertSliceNumbers traverses the slice, converting any json.Number values to int64 or float64. values which are map[string]interface{} or []interface{} are recursively visited

func Filter

func Filter(obj map[string]interface{}, filter map[string]interface{}) (map[string]interface{}, error)

func Marshal

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

Marshal delegates to json.Marshal It is only here so this package can be a drop-in for common encoding/json uses

func MarshalIndent

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

MarshalIndent delegates to json.MarshalIndent It is only here so this package can be a drop-in for common encoding/json uses

func NewEncoder

func NewEncoder(w io.Writer) *json.Encoder

NewEncoder delegates to json.NewEncoder It is only here so this package can be a drop-in for common encoding/json uses

func Unmarshal

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

Unmarshal unmarshals the given data If v is a *map[string]interface{}, *[]interface{}, or *interface{} numbers are converted to int64 or float64

Types

This section is empty.

Source Files

Directories

Path Synopsis
Package types provides a collection of Golang types with JSON marshaling support
Package types provides a collection of Golang types with JSON marshaling support

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL