Documentation
¶
Index ¶
- func IsNil(json *Json) bool
- func Tabify(json *Json, opt ...TabifyOption) ([]map[string]interface{}, error)
- type Json
- func Assign(source *Json, json ...*Json) *Json
- func Filter(collection []*Json, predicate func(v *Json) bool) []*Json
- func FromBytes(bytes []byte) *Json
- func FromMap(m map[string]interface{}) *Json
- func FromString(str string) *Json
- func Map(collection []*Json, iteratee func(v *Json) *Json) []*Json
- func New() *Json
- func Nil() *Json
- func (j *Json) AsArray() []interface{}
- func (j *Json) AsBool() bool
- func (j *Json) AsFloat() float64
- func (j *Json) AsInt() int64
- func (j *Json) AsObject() map[string]interface{}
- func (j *Json) AsString() string
- func (j *Json) AsUint() uint64
- func (j *Json) Bytes() []byte
- func (j *Json) Data() interface{}
- func (j *Json) ForEach(iteratee func(k string, v *Json) bool)
- func (j *Json) Get(path string) *Json
- func (j *Json) Has(path string) bool
- func (j *Json) IsArray() bool
- func (j *Json) IsNil() bool
- func (j *Json) IsObject() bool
- func (j *Json) IsValue() bool
- func (j *Json) Keys() []string
- func (j *Json) MarshalJSON() ([]byte, error)
- func (j *Json) Rewrite(oldPath string, newPath string) bool
- func (j *Json) Set(path string, value ...interface{}) bool
- func (j *Json) SetJSON(path string, json ...*Json) bool
- func (j *Json) Stringify() string
- func (j *Json) UnmarshalJSON(data []byte) error
- func (j *Json) Unset(path string) bool
- func (j *Json) Values() []*Json
- func (j *Json) Wrap(path string) *Json
- type TabifyKeyExcluderFunc
- type TabifyKeyFormatterFunc
- type TabifyOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Json ¶
type Json struct {
// contains filtered or unexported fields
}
Json is our wrapper to an unmarshalled json
func Assign ¶
Assign Assigns own enumerable string keyed properties of source objects to the destination object.
func Filter ¶
Filter iterates over elements of collection, returning an array of all elements predicate returns truthy for.
func (*Json) AsArray ¶
func (j *Json) AsArray() []interface{}
AsArray casts underlying to array ([]interface{}) Returns nil if not an array
func (*Json) AsObject ¶
AsObject casts underlying to object (map[string]interface{}) Returns nil if not an object
func (*Json) ForEach ¶
ForEach : Iterates over elements of collection and invokes iteratee for each element. Iteratee functions may exit iteration early by explicitly returning false.
func (*Json) MarshalJSON ¶
Marshaler interface encoding/json encode.go
func (*Json) Set ¶
Set sets the value at path of object. If a portion of path doesn't exist, it's created. Arrays are created for missing index properties while objects are created for all other missing properties
func (*Json) UnmarshalJSON ¶
Unmarshaler interface encoding/json decode.go
type TabifyKeyExcluderFunc ¶
type TabifyKeyFormatterFunc ¶
type TabifyOption ¶
type TabifyOption func(t *tabify)
TabifyOption is an option setter to tabify
func TabifyKeyExcluder ¶
func TabifyKeyExcluder(v TabifyKeyExcluderFunc) TabifyOption
TabifyKeyExcluder sets the key excluder default : func (keys []string) => false
func TabifyKeyFormatter ¶
func TabifyKeyFormatter(v TabifyKeyFormatterFunc) TabifyOption
TabifyKeyFormatter sets the key formatter default : func (keys []string) => strings.Join(keys, "#")
