goson: github.com/panthesingh/goson Index | Files

package goson

import "github.com/panthesingh/goson"

Index

Package Files

goson.go

type Goson Uses

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

Goson object

func New Uses

func New(i interface{}) *Goson

func Parse Uses

func Parse(data []byte) (*Goson, error)

Parse will create a goson object from json data

func (*Goson) Bool Uses

func (g *Goson) Bool() bool

Bool returns the bool value.

func (*Goson) Float Uses

func (g *Goson) Float() float64

Float returns the underlying float64 value.

func (*Goson) Get Uses

func (g *Goson) Get(key string) *Goson

Get returns a goson object from a key. If the value does not exist this will still return a goson object.

func (*Goson) Index Uses

func (g *Goson) Index(index int) *Goson

Index is used to access the index of an array object.

func (*Goson) Int Uses

func (g *Goson) Int() int

Int returns the underlying Int value converted from a float64.

func (*Goson) Len Uses

func (g *Goson) Len() int

Len will return len() on the underlying value. If the value does not have a length the return value will be 0.

func (*Goson) Map Uses

func (g *Goson) Map() map[string]interface{}

Map returns the underlying map value.

func (*Goson) Set Uses

func (g *Goson) Set(key string, value interface{}) *Goson

Set returns a goson object after change the value If the value does not exist this will still return a goson object.

func (*Goson) Slice Uses

func (g *Goson) Slice() []interface{}

Slice returns the underlying slice value.

func (*Goson) String Uses

func (g *Goson) String() string

String will convert the underlying value as a string if it can or return an empty string. If the object is a JSON map or array it will return the structure in an indented format.

func (*Goson) Value Uses

func (g *Goson) Value() interface{}

Value will retrieve the underlying interface value.

Package goson imports 2 packages (graph). Updated 2018-08-15. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).