djson

package
v0.0.0-...-800adf3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: ISC Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFormat = errors.New("invalid format")

Functions

func AsBoolean

func AsBoolean(v Value) bool

func AsNumber

func AsNumber(v Value) float64

func AsObject

func AsObject(v Value) map[string]Value

func AsString

func AsString(v Value) string

func Equal

func Equal(v1, v2 Value) bool

func IsArray

func IsArray(v Value) bool

func IsBoolean

func IsBoolean(v Value) bool

func IsNumber

func IsNumber(v Value) bool

func IsObject

func IsObject(v Value) bool

func IsString

func IsString(v Value) bool

func ObjectKeys

func ObjectKeys(v Value) []string

Types

type InvalidValueError

type InvalidValueError struct {
	Value interface{}
}

func (*InvalidValueError) Error

func (err *InvalidValueError) Error() string

type Pointer

type Pointer []string

func NewPointer

func NewPointer(tokens ...string) Pointer

func (*Pointer) Append

func (p *Pointer) Append(tokens ...string)

func (Pointer) Child

func (p Pointer) Child(tokens ...string) Pointer

func (Pointer) Find

func (p Pointer) Find(value interface{}) interface{}

func (Pointer) MarshalJSON

func (p Pointer) MarshalJSON() ([]byte, error)

func (*Pointer) MustParse

func (p *Pointer) MustParse(s string)

func (Pointer) Parent

func (p Pointer) Parent() Pointer

func (*Pointer) Parse

func (p *Pointer) Parse(s string) error

func (*Pointer) Prepend

func (p *Pointer) Prepend(tokens ...string)

func (Pointer) String

func (p Pointer) String() string

func (*Pointer) UnmarshalJSON

func (p *Pointer) UnmarshalJSON(data []byte) error

type Value

type Value interface{}

func AsArray

func AsArray(v Value) []Value

func ObjectValues

func ObjectValues(v Value) []Value

Jump to

Keyboard shortcuts

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