json

package
v0.0.0-...-2f64ca4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array []Value

func (Array) AsArray

func (a Array) AsArray() []Value

func (Array) AsBool

func (Array) AsBool() bool

func (Array) AsFloat64

func (Array) AsFloat64() float64

func (Array) AsInt64

func (Array) AsInt64() int64

func (Array) AsObject

func (Array) AsObject() map[string]Value

func (Array) AsString

func (Array) AsString() string

func (Array) IsArray

func (Array) IsArray() bool

func (Array) IsBool

func (Array) IsBool() bool

func (Array) IsNull

func (Array) IsNull() bool

func (Array) IsNumber

func (Array) IsNumber() bool

func (Array) IsObject

func (Array) IsObject() bool

func (Array) IsString

func (Array) IsString() bool

func (Array) ValueType

func (Array) ValueType() json.ValueType

type Bool

type Bool bool

func (Bool) AsArray

func (Bool) AsArray() []Value

func (Bool) AsBool

func (b Bool) AsBool() bool

func (Bool) AsFloat64

func (Bool) AsFloat64() float64

func (Bool) AsInt64

func (Bool) AsInt64() int64

func (Bool) AsObject

func (Bool) AsObject() map[string]Value

func (Bool) AsString

func (Bool) AsString() string

func (Bool) IsArray

func (Bool) IsArray() bool

func (Bool) IsBool

func (Bool) IsBool() bool

func (Bool) IsNull

func (Bool) IsNull() bool

func (Bool) IsNumber

func (Bool) IsNumber() bool

func (Bool) IsObject

func (Bool) IsObject() bool

func (Bool) IsString

func (Bool) IsString() bool

func (Bool) ValueType

func (Bool) ValueType() json.ValueType

type Null

type Null struct{}

func (Null) AsArray

func (Null) AsArray() []Value

func (Null) AsBool

func (Null) AsBool() bool

func (Null) AsFloat64

func (Null) AsFloat64() float64

func (Null) AsInt64

func (Null) AsInt64() int64

func (Null) AsObject

func (Null) AsObject() map[string]Value

func (Null) AsString

func (Null) AsString() string

func (Null) IsArray

func (Null) IsArray() bool

func (Null) IsBool

func (Null) IsBool() bool

func (Null) IsNull

func (Null) IsNull() bool

func (Null) IsNumber

func (Null) IsNumber() bool

func (Null) IsObject

func (Null) IsObject() bool

func (Null) IsString

func (Null) IsString() bool

func (Null) ValueType

func (Null) ValueType() json.ValueType

type Number

type Number float64

func (Number) AsArray

func (Number) AsArray() []Value

func (Number) AsBool

func (Number) AsBool() bool

func (Number) AsFloat64

func (n Number) AsFloat64() float64

func (Number) AsInt64

func (n Number) AsInt64() int64

func (Number) AsObject

func (Number) AsObject() map[string]Value

func (Number) AsString

func (Number) AsString() string

func (Number) IsArray

func (Number) IsArray() bool

func (Number) IsBool

func (Number) IsBool() bool

func (Number) IsNull

func (Number) IsNull() bool

func (Number) IsNumber

func (Number) IsNumber() bool

func (Number) IsObject

func (Number) IsObject() bool

func (Number) IsString

func (Number) IsString() bool

func (Number) ValueType

func (Number) ValueType() json.ValueType

type Object

type Object map[string]Value

func (Object) AsArray

func (Object) AsArray() []Value

func (Object) AsBool

func (Object) AsBool() bool

func (Object) AsFloat64

func (Object) AsFloat64() float64

func (Object) AsInt64

func (Object) AsInt64() int64

func (Object) AsObject

func (o Object) AsObject() map[string]Value

func (Object) AsString

func (Object) AsString() string

func (Object) IsArray

func (Object) IsArray() bool

func (Object) IsBool

func (Object) IsBool() bool

func (Object) IsNull

func (Object) IsNull() bool

func (Object) IsNumber

func (Object) IsNumber() bool

func (Object) IsObject

func (Object) IsObject() bool

func (Object) IsString

func (Object) IsString() bool

func (Object) ValueType

func (Object) ValueType() json.ValueType

type ParseError

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

func (*ParseError) Error

func (e *ParseError) Error() string

type String

type String string

func (String) AsArray

func (String) AsArray() []Value

func (String) AsBool

func (String) AsBool() bool

func (String) AsFloat64

func (String) AsFloat64() float64

func (String) AsInt64

func (String) AsInt64() int64

func (String) AsObject

func (String) AsObject() map[string]Value

func (String) AsString

func (s String) AsString() string

func (String) IsArray

func (String) IsArray() bool

func (String) IsBool

func (String) IsBool() bool

func (String) IsNull

func (String) IsNull() bool

func (String) IsNumber

func (String) IsNumber() bool

func (String) IsObject

func (String) IsObject() bool

func (String) IsString

func (String) IsString() bool

func (String) ValueType

func (String) ValueType() json.ValueType

type Value

type Value interface {
	ValueType() json.ValueType

	// These methods return whether or not the underlying value is of a
	// given type.
	IsNull() bool
	IsBool() bool
	IsNumber() bool
	IsString() bool
	IsArray() bool
	IsObject() bool

	// These methods always return the zero value for the given type unless it
	// is the actual underlying value.
	AsBool() bool
	AsInt64() int64
	AsFloat64() float64
	AsString() string
	AsArray() []Value
	AsObject() map[string]Value
}

func Parse

func Parse(data []byte) (Value, error)

Jump to

Keyboard shortcuts

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