gj

package module
v0.0.0-...-b42f2fb Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2014 License: MIT Imports: 2 Imported by: 0

README

gj

API Document

Samples

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JSON         = Codec{jsonMarshal, jsonUnmarshal}
	DefaultCodec = JSON
)

Functions

This section is empty.

Types

type Codec

type Codec struct {
	Marshal   func(v interface{}) (data []byte, err error)
	Unmarshal func(data []byte, v interface{}) (err error)
}

type Value

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

func New

func New(data []byte) (*Value, error)

func NewWithCodec

func NewWithCodec(data []byte, codec Codec) (*Value, error)

func ValueOf

func ValueOf(v interface{}) *Value

func (*Value) Bool

func (v *Value) Bool() bool

func (*Value) EachIndex

func (v *Value) EachIndex(f func(i int, v *Value) bool)

func (*Value) EachKey

func (v *Value) EachKey(f func(k string, v *Value) bool)

func (*Value) Find

func (v *Value) Find(f func(v *Value) (ok, end bool)) <-chan *Value

func (*Value) Float

func (v *Value) Float() float64

func (*Value) Get

func (v *Value) Get(k string) *Value

func (*Value) Has

func (v *Value) Has(k string) bool

func (*Value) Index

func (v *Value) Index(i int) *Value

func (*Value) Int

func (v *Value) Int() int64

func (*Value) IsArray

func (v *Value) IsArray() bool

func (*Value) IsBool

func (v *Value) IsBool() bool

func (*Value) IsNumber

func (v *Value) IsNumber() bool

func (*Value) IsObject

func (v *Value) IsObject() bool

func (*Value) IsString

func (v *Value) IsString() bool

func (*Value) Isolate

func (v *Value) Isolate() *Value

func (*Value) Keys

func (v *Value) Keys() []string

func (*Value) Len

func (v *Value) Len() int

func (*Value) Marshal

func (v *Value) Marshal() (data []byte, err error)

func (*Value) Parent

func (v *Value) Parent() *Value

func (*Value) ParentIndex

func (v *Value) ParentIndex() int

func (*Value) ParentKey

func (v *Value) ParentKey() string

func (*Value) Slice

func (v *Value) Slice(i, j int) *Value

func (*Value) String

func (v *Value) String() string

func (*Value) Traversal

func (v *Value) Traversal(f func(v *Value) (end bool))

func (*Value) TryGet

func (v *Value) TryGet(k string) (*Value, bool)

func (*Value) Unmarshal

func (v *Value) Unmarshal(dst interface{}) (err error)

Directories

Path Synopsis
samples

Jump to

Keyboard shortcuts

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