apimachineryk8s.io/apimachinery/pkg/util/json Index | Files

package json

import "k8s.io/apimachinery/pkg/util/json"

Index

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 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 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. Object keys are case-sensitive. Numbers decoded into interface{} fields are converted to int64 or float64.

Source Files

json.go

Version
v0.32.2
Published
Dec 6, 2024
Platform
js/wasm
Imports
4 packages
Last checked
7 hours ago

Tools for package owners.