json

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Code specific to deserializing JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

The deserialization driver for JSON.

func (Driver) ShouldUnmarshal

func (u Driver) ShouldUnmarshal(typ reflect.Type) bool

Determine whether we should call the driver to unmarshal values of this type from []byte.

For JSON, this is the case if: - `typ` represents a dictionary; and/or - `typ` implements `json.Unmarshaler`.

You probably won't ever need to call this method.

func (Driver) Unmarshal

func (u Driver) Unmarshal(in any, out *any) (err error)

Perform unmarshaling.

You probably won't ever need to call this method.

func (Driver) WrapValue

func (u Driver) WrapValue(wrapped any) shared.Value

type JSON

type JSON map[string]any

A JSON object.

func (JSON) AsValue

func (json JSON) AsValue() shared.Value

func (JSON) Keys

func (json JSON) Keys() []string

func (JSON) Lookup

func (json JSON) Lookup(key string) (shared.Value, bool)

type Value

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

A JSON value.

func (Value) AsDict

func (v Value) AsDict() (shared.Dict, bool)

func (Value) AsSlice

func (v Value) AsSlice() ([]shared.Value, bool)

func (Value) Interface

func (v Value) Interface() any

Jump to

Keyboard shortcuts

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