jsonp

package
v0.0.0-...-f1ebe90 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PointerEscaper is a replacer to replace `~`, `/` with `~0`, `~1`.
	PointerEscaper = strings.NewReplacer("~", "~0", "/", "~1")
	// PointerUnescaper is a replacer to replace `~0`, `~1` with `~`, `/`.
	PointerUnescaper = strings.NewReplacer("~0", "~", "~1", "/")
)

Functions

func Move2

func Move2(x, y Any, from, to string) (Any, Any, error)

Move2 moves a child to another place. The source and target can be different.

func Test

func Test(x Any, pointer string, v Any) error

Test checks if child matches the node.

Types

type Any

type Any = interface{}

Any represents any JSON node.

func Add

func Add(x Any, pointer string, v Any) (Any, error)

Add adds a node to a node by pointer.

func Clone

func Clone(x Any) Any

Clone makes a copy of a JSON node.

func Copy

func Copy(x Any, from, to string) (Any, error)

Copy copies a child node to another place.

func Copy2

func Copy2(x, y Any, from, to string) (Any, error)

Copy2 copies a child node to another place. The source and target can be different.

func Get

func Get(x Any, pointer string) (Any, error)

Get returns child node of a node.

func Merge

func Merge(x, v Any) Any

Merge merges two nodes.

func Move

func Move(x Any, from, to string) (Any, error)

Move moves a child to another place.

func Remove

func Remove(x Any, pointer string) (Any, error)

Remove removes child of a node.

func Replace

func Replace(x Any, pointer string, v Any) (Any, error)

Replace replaces child of a node with another.

type Array

type Array = []Any

Array represents JSON arrays.

type Object

type Object = map[string]Any

Object represents JSON objects.

Jump to

Keyboard shortcuts

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