jsonx

package
v0.0.0-...-d070082 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Array

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

func (*Array) Append

func (a *Array) Append(vals ...*Value) *Array

func (*Array) Copy

func (a *Array) Copy() *Array

func (*Array) Iterator

func (a *Array) Iterator() Iterator

func (*Array) Len

func (a *Array) Len() int

func (*Array) MarshalJSON

func (a *Array) MarshalJSON() ([]byte, error)

func (*Array) UnmarshalJSON

func (a *Array) UnmarshalJSON(in []byte) error

type ArrayConstructor

type ArrayConstructor struct{}

func (ArrayConstructor) Bytes

func (ArrayConstructor) Bytes(in []byte) *Array

func (ArrayConstructor) BytesErr

func (ArrayConstructor) BytesErr(in []byte) (*Array, error)

func (ArrayConstructor) Elements

func (ArrayConstructor) Elements(elems ...*Value) *Array

func (ArrayConstructor) Make

func (ArrayConstructor) Make(n int) *Array

func (ArrayConstructor) New

func (ArrayConstructor) New() *Array

func (ArrayConstructor) Reader

func (ArrayConstructor) Reader(in io.Reader) *Array

func (ArrayConstructor) ReaderErr

func (ArrayConstructor) ReaderErr(in io.Reader) (*Array, error)

type Document

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

func (*Document) Append

func (d *Document) Append(elems ...*Element) *Document

func (*Document) Copy

func (d *Document) Copy() *Document

func (*Document) ElementAtIndex

func (d *Document) ElementAtIndex(idx int) *Element

func (*Document) Iterator

func (d *Document) Iterator() Iterator

func (*Document) KeyAtIndex

func (d *Document) KeyAtIndex(idx int) string

func (*Document) Len

func (d *Document) Len() int

func (*Document) MarshalJSON

func (d *Document) MarshalJSON() ([]byte, error)

func (*Document) UnmarshalJSON

func (d *Document) UnmarshalJSON(in []byte) error

type DocumentConstructor

type DocumentConstructor struct{}

func (DocumentConstructor) Bytes

func (DocumentConstructor) Bytes(in []byte) *Document

func (DocumentConstructor) BytesErr

func (DocumentConstructor) BytesErr(in []byte) (*Document, error)

func (DocumentConstructor) Elements

func (DocumentConstructor) Elements(elems ...*Element) *Document

func (DocumentConstructor) Make

func (DocumentConstructor) Make(n int) *Document

func (DocumentConstructor) New

func (DocumentConstructor) Reader

func (DocumentConstructor) Reader(in io.Reader) *Document

func (DocumentConstructor) ReaderErr

func (DocumentConstructor) ReaderErr(in io.Reader) (*Document, error)

type Element

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

func (*Element) Copy

func (e *Element) Copy() *Element

func (*Element) Key

func (e *Element) Key() string

func (*Element) Value

func (e *Element) Value() *Value

func (*Element) ValueOK

func (e *Element) ValueOK() (*Value, bool)

type ElementConstructor

type ElementConstructor struct{}

func (ElementConstructor) Array

func (ElementConstructor) Array(key string, a *Array) *Element

func (ElementConstructor) ArrayFromElements

func (ElementConstructor) ArrayFromElements(key string, elems ...*Value) *Element

func (ElementConstructor) Boolean

func (ElementConstructor) Boolean(key string, val bool) *Element

func (ElementConstructor) Float32

func (ElementConstructor) Float32(key string, n float32) *Element

func (ElementConstructor) Float64

func (ElementConstructor) Float64(key string, n float64) *Element

func (ElementConstructor) Int

func (ElementConstructor) Int(key string, n int) *Element

func (ElementConstructor) Int32

func (ElementConstructor) Int32(key string, n int32) *Element

func (ElementConstructor) Int64

func (ElementConstructor) Int64(key string, n int64) *Element

func (ElementConstructor) Nil

func (ElementConstructor) Nil(key string) *Element

func (ElementConstructor) Object

func (ElementConstructor) Object(key string, doc *Document) *Element

func (ElementConstructor) ObjectFromElements

func (ElementConstructor) ObjectFromElements(key string, elems ...*Element) *Element

func (ElementConstructor) String

func (ElementConstructor) String(key string, value string) *Element

func (ElementConstructor) Value

func (ElementConstructor) Value(key string, val *Value) *Element

type Iterator

type Iterator interface {
	Err() error
	Next() bool
	Element() *Element
	Value() *Value
}

type Type

type Type int

Type describes

const (
	// String is a json string
	String Type = iota

	// Number is a json number.
	Number

	// Bool is a boolean value that is either true or false.
	Bool

	// Null is a null json value.
	Null

	// NumberInteger refers to integer values. This translates to a
	// JSON number.
	NumberInteger

	// NumberInteger refers to a float/double value. This translates to a
	// JSON number.
	NumberDouble

	// ObjectValues are json objects.
	ObjectValue

	// ArrayValues are json arrays.
	ArrayValue
)

func (Type) String

func (t Type) String() string

String returns a string representation of the type.

type Value

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

func (*Value) Array

func (v *Value) Array() *Array

func (*Value) ArrayOK

func (v *Value) ArrayOK() (*Array, bool)

func (*Value) Boolean

func (v *Value) Boolean() bool

func (*Value) BooleanOK

func (v *Value) BooleanOK() (bool, bool)

func (*Value) Copy

func (v *Value) Copy() *Value

func (*Value) Document

func (v *Value) Document() *Document

func (*Value) DocumentOK

func (v *Value) DocumentOK() (*Document, bool)

func (*Value) Float64

func (v *Value) Float64() float64

func (*Value) Float64OK

func (v *Value) Float64OK() (float64, bool)

func (*Value) Int

func (v *Value) Int() int

func (*Value) IntOK

func (v *Value) IntOK() (int, bool)

func (*Value) Interface

func (v *Value) Interface() interface{}

func (*Value) MarshalJSON

func (v *Value) MarshalJSON() ([]byte, error)

func (*Value) StringValue

func (v *Value) StringValue() string

func (*Value) StringValueOK

func (v *Value) StringValueOK() (string, bool)

func (*Value) Type

func (v *Value) Type() Type

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(in []byte) error

type ValueConstructor

type ValueConstructor struct{}

func (ValueConstructor) Array

func (ValueConstructor) Array(a *Array) *Value

func (ValueConstructor) ArrayFromElements

func (ValueConstructor) ArrayFromElements(elems ...*Value) *Value

func (ValueConstructor) Boolean

func (ValueConstructor) Boolean(b bool) *Value

func (ValueConstructor) Bytes

func (ValueConstructor) Bytes(in []byte) *Value

func (ValueConstructor) BytesErr

func (ValueConstructor) BytesErr(in []byte) (*Value, error)

func (ValueConstructor) Float32

func (ValueConstructor) Float32(n float32) *Value

func (ValueConstructor) Float64

func (ValueConstructor) Float64(n float64) *Value

func (ValueConstructor) Int

func (ValueConstructor) Int(n int) *Value

func (ValueConstructor) Int32

func (ValueConstructor) Int32(n int32) *Value

func (ValueConstructor) Int64

func (ValueConstructor) Int64(n int64) *Value

func (ValueConstructor) Nil

func (ValueConstructor) Nil() *Value

func (ValueConstructor) Object

func (ValueConstructor) Object(doc *Document) *Value

func (ValueConstructor) ObjectFromElements

func (ValueConstructor) ObjectFromElements(elems ...*Element) *Value

func (ValueConstructor) Reader

func (ValueConstructor) Reader(in io.Reader) *Value

func (ValueConstructor) ReaderErr

func (ValueConstructor) ReaderErr(in io.Reader) (*Value, error)

func (ValueConstructor) String

func (ValueConstructor) String(s string) *Value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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